
18-06-2004, 15:15
|
 |
 |
Why did I come back?
AKA: Jamie Bliss
 FRC #4967 (That ONE Team)
Team Role: Mentor
|
|
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
|
|
|
Re: FIRST Video Game: Cementing auxillary file formats
DEFINITION: Item - The actual CAD of something, for lack of a better name.
- The only required item in the root of the zip is Info.Ini
- Each directory in the ZIP has its own section.
- Every atempt should be made to make sure it is UNIQUE. It is also its ID.
Code:
[DirName]
Type= Game, Field, or Robot
DisplayName= What is shown to the user
Game= The ID of the game it is for (not for games)
Year= The year of the item (optional)
Description= An extended description of the item
ThingID= The file name for an item (the ID being the entry), several of these. This may also be in code.
- A zip may contain multiple items
- Games should include a default Field and robot.
- Suggested Robot ID: year.team.name (year of game, team number, name of bot)
Suggested DLL interfaces (in psuedo C++):
Code:
#define RETURN_ERR bool
//used for subs that return error info
#define BOT_SCORES unsigned long[]
the scores for a match
#define CAD i3DSMaxObject
//example, going to change
/////////////////////////////////////////////////////////////////////////////////////////////
iField Interface:
RETURN_ERR SetFieldItem(long ID, i3DSMaxObject* Field); //Sets a reference to an actual item
RETURN_ERR DoThing(long ID); //Year specific action
/////////////////////////////////////////////////////////////////////////////////////////////
iRobot Interface:
RETURN_ERR SetRobot(i3DSMaxObject* Robot); //Sets a reference to the actual robot
long GetTeamNumber(); //Gets the team number
RETURN_ERR Update(lnog TimeStamp); //tells it to update it's position
//called after OI info is set
RETURN_ERR BeginPrematch(); //Begins the disabled mode before the match
RETURN_ERR BeginMatch(); //Begins the actual match
RETURN_ERR EndMatch(); //Ends the match
bool CanAI(); //Can this bot do AIs?
long GetYear(); //What year is it for?
Properties:
Operator_IO OI_Info(); //The structure with all the info sent to/from the OI
ULONG Alliance(); //The current alliance, Actually an RGB color
bool AI(); //Is it acting as an AI? Always returns False if CanAI is false
/////////////////////////////////////////////////////////////////////////////////////////////
iGame Interface:
long GetNumBots(); //The total number of bots required
long GetNumAlliances(); //The number of alliances required
RETURN_ERR SetBot(long ID, iRobot* Robot); //Sets the reference to a iRobot
RETURN_ERR BeginPrematch(); //Begin prematch
RETURN_ERR BeginMatch(); //Begin Match
RETURN_ERR HaltMatch(); //Field error, prematurely stops match
RETURN_ERR SetField(iField* Field); //Sets the reference to the iField
Properties:
BOT_SCORES CurrentScores(); //The current scores
Events:
void MatchFinish(UINT Winner, BOT_SCORES Scores); //Raised when the match finishes normally
- A DLL must present the apropriate interface
- The objects are not responsible for loading an item, it is loaded by the program and the reference set.
- An object may do whatever it wants, but emphasis is on speed. Multi-threading is encouraged.
Last edited by Astronouth7303 : 18-06-2004 at 15:23.
Reason: needed revision, changes in bold.
|