AIDORU AI engine for PS2 README version 0.01 updated 2002 may 22 please send questions and comments to yonder@nyc2600.org (temporarily down) yonderboy@nyc2600.org (temporarily down) y0nd3rb0y@mac.com The purpose of this document is to outline some project goals and set a preliminary coding style for people who want to contribute code. This will all probably be rewritten when my PS2 dev kit actually arrives. VERSION NUMBERS I think I'll stick to this notation: 3.13.37 - The 37 refers to bug fixes and individual functions added - The 13 refers to the completion of a related set of functions (ie: all functions needed to do A*) - The 1 represents the major release number WHAT AM I DOING HERE??? Aidoru is a PS2 AI engine written to supply game developers with general AI functionaliy (and some specific experimental stuff) that takes advantage of the PS2's parallel architecture. The name is a bit of a pun in that AI stands for Artificial Intelligence and Aidoru is japanese for idol. Wonderfully, many aidoru in Japan are virtual and have intensive AI components used to write songs, talk to fans, give "concerts" and appear in TV/movies. Of course I am not doing anything near that grand scale but I'm using the name AIdoru anyway. Off the top of my head, I plan the following features (list to be expanded once I get working): PATHFINDING - Console optimized A* path search - Hierarchical pathfinding - Catmull-rom path smoothing - Navigation meshes - Hill climbing TREE SEARCH - Depth first search - Breadth first search - Iterative deepening - Iterative broadening NEURAL NETS - General purpose multi-layer feedforward ned - Hopfield net to simulate memory - Autoassociator/autoencoder for classical conditioning and memory REASONING AND LOGIC - A prolog-style logic proof generator/logic resolution - Supports conjunctions, disjunctions, statements, facts, rules, queries - Look into ways to make it FASTER COMMUNICATION - Messages - leader-follower and follower-follower communication - Group behaviour EXPERIMENTAL - Learning - GA/Evolution - other CODING STYLE I dont want to impose too many restrictions but for the sake of code compatibility and readability, I do require a few things, some of which are pretty common coding practice and common sense. 1) Write in C and not C++. I am not a big fan of objects and I really despise the STL so please try to stick to ANSII C. This involves much more than changing your classes to structs so please know the language. Keep all your code as tight and bug free as possible. 2) For time critical routines that will be called many times, try to write VU0 optimized assembly. Find ways to use the parallel FP MAC capabilities of the FPU and VU0. Optimize your algorithms and most importantly, know PS2 architecture! 3) hardcode all numeric constants with defines in header files. 4) PLEASE do not place braces on the same line as your function defs, whiles, fors, or ifs... for example: RIGHT: if (node->loc == GOAL) { ... } WRONG!!!: if (braces == annoying) { ... } 5) Variable names and function names should give a hint to what is going on but try to comment things to help understanding. Comment any clever hacks that might not be obvious and use comments to explain algorithms step by step. However, you do NOT need to overcomment: array_ptr++; /* increment array_ptr by 1 - thanks captain obvious */ 6) Aside from that, I cant really think of anything else that really bothers me. Just try to have fun and bask in the glory that is the PS2 homebrew dev scene ;) VARIABLE AND FUNCTION NAMING Choose names that make sense to help code readability. Use underscores instead of mixed case notation. For example frame_count is preferred to FrameCount.