# A Game of Billiards in Empirical Modelling Richard Coleman.

## Presentation on theme: "A Game of Billiards in Empirical Modelling Richard Coleman."— Presentation transcript:

A Game of Billiards in Empirical Modelling Richard Coleman

Presentation Overview (1)  Background to the Project –Involvement with the EM Group –What is EM? –Choice of Project to Take Over  Development –Level 1 –Level 2 –Level 3 –Level 4 –Level 5 –Level 6

Presentation Overview (2)  Summary of Functionality  Problems Encountered –What Were They? –How Were They Dealt With?  Future Extensions  Summary and Conclusion  Questions

Background to the Project  Joined EM Group in Summer 2003  What is Empirical Modelling? –Modelling the “Real World” using: Observables, which are constants about the domain being modelled Dependencies, which hold between the Observables Agents, which cause changes to the Observables and the system –Attempts to bridge divide between “Real World” and the formality of Logic & Maths –www.dcs.warwick.ac.uk/modellingwww.dcs.warwick.ac.uk/modelling Background  EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Choice of Model to Use  Three existing models in EM archive: –Simon Yung, 1996 –Alexei Moissenkov, 1999 –Ben Carter, 1999  Chose to use Moissenkov 1999 because: –Good use of levels –Easy to extend –Lack of complexity found in others Background EM  Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 1  Moissenkov’s Level 1 very limited  Implemented a complete table, with pockets and ball re-spotting  Added a level loader  Added a reset button Background EM Project Choice Development  Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 1 Background EM Project Choice Development  Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 2  Moissenkov simply added friction  Implemented extra balls, complete with ball-respotting  Implemented cue ball repositioning Background EM Project Choice Development Level 1  Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 2 (Moissenkov) Background EM Project Choice Development Level 1  Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 2 (Coleman) Background EM Project Choice Development Level 1  Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 3  Moissenkov added balls and replay facility  Filtered out replay code and made it into a completely separate level  Replay available at the touch of a button Background EM Project Choice Development Level 1 Level 2  Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 4  Level at which rules are added  Includes scoreboard, and detection of all types of shots  Graphically looks similar to Moissenkov’s top level  Functionally similar to Moissenkov too Background EM Project Choice Development Level 1 Level 2 Level 3  Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 4 (Coleman) Background EM Project Choice Development Level 1 Level 2 Level 3  Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 5  Completely new level, implementing Spin (aka “English”)  Spin chosen by clicking on ball image on RHS  Selection image changes colour according to whose shot it is  Calculations include spin off of cushions Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4  Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 5 Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4  Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 6  Implements a playable Artificial Intelligence  Calculates 3 types of shot: –Pot –In-Off –Cannon  Chooses and takes most appropriate shot  Skill and “Adventurousness” can be varied using scrollbars Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5  Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Level 6 Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5  Level 6 Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Summary of Functionality (1)  Completely working 4-layered Billiards model, based on but an improvement of billiardsMoissenkov1999  Improvements include: –Restructuring of layers –Addition of a model reset facility –Addition of a level loader Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6  Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Summary of Functionality (2)  Partial implementation of cue ball spin –Interface completed and functional –Problems with Physics  Partial implementation of fully playable Artificial Intelligence  How is it an Empirical Model? –More on this in project demonstration Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6  Summary of Functionality Problems What they were Solutions Extensions Summary + Conclusion

Problems Encountered  Time Management not the issue!  Spin is a complex and little-understood mathematical problem  Potting a ball is easy  Calculating in-offs and cannons is not  Rules of inherited model were poor What went wrong… Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems  What they were Solutions Extensions Summary + Conclusion

Problems Encountered  Main focus on AI, since Spin has been looked at in previous projects  Recognition that in-off and cannon are essentially the same shot  Attempt to build an approximation method for in-offs –Problems with pockets and table orientation  More on this in demonstration Attempted Solutions… Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were  Solutions Extensions Summary + Conclusion

Future Extensions  Fix implementations of Spin & AI –May be completed before Report  Implement AI taking shots off cushions  Implement AI learning and improving its play –Possibly through use of an EDDI database  Convert Non-AI levels to dtkEden –Two player game over a network Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions  Extensions Summary + Conclusion

Summary and Conclusion  Model has come a long way since Moissenkov  Spin a slight disappointment but may be (relatively) easily fixed  AI does take shots  Plenty of scope for extension / improvement by myself and / or others –Perhaps next year’s project students! Background EM Project Choice Development Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Summary of Functionality Problems What they were Solutions Extensions  Summary + Conclusion

Questions? Richard Coleman 2004