Jigsphere.files.wordpress.com



MAGICARCERTECHNICAL DESIGN DOCUMENTMM13-4AGerry Satyanegara[4116628]Eugene Tan [4246299]Ren Tang Lee [4321881]Nicholas Leong [4186618] Contents TOC \o "1-3" \h \z \u Platform and OS PAGEREF _Toc380776413 \h 3Control Loop PAGEREF _Toc380776414 \h 4Details PAGEREF _Toc380776415 \h 5Game Object Data PAGEREF _Toc380776416 \h 7Reference PAGEREF _Toc380776417 \h 7Level PAGEREF _Toc380776418 \h 7Character PAGEREF _Toc380776419 \h 8Camera PAGEREF _Toc380776420 \h 9Controller PAGEREF _Toc380776421 \h 9AIController PAGEREF _Toc380776422 \h 10JigSphereGuide PAGEREF _Toc380776423 \h 11JigSphereMainSPhere PAGEREF _Toc380776424 \h 11JigSphereMainSPhereHover PAGEREF _Toc380776425 \h 11JigSpherePieceControl PAGEREF _Toc380776426 \h 12Game Physics and Statistics PAGEREF _Toc380776427 \h 13Controller PAGEREF _Toc380776428 \h 13Camera PAGEREF _Toc380776429 \h 14AI – Artificial Intelligence PAGEREF _Toc380776430 \h 15Path Finding PAGEREF _Toc380776431 \h 15Movement State PAGEREF _Toc380776432 \h 15Attacking State PAGEREF _Toc380776433 \h 15Target Selection PAGEREF _Toc380776434 \h 16Reaction/Behaviours PAGEREF _Toc380776435 \h 16Art & Video PAGEREF _Toc380776436 \h 17Graphics Engine PAGEREF _Toc380776437 \h 17Artist Instructions PAGEREF _Toc380776438 \h 17Level Specific Code PAGEREF _Toc380776439 \h 17Platform and OSMinimum Requirement:Windows XP SP3 or Windows Vista2.0+ GHz processor2 GB system RAM2 GB hard drive spaceRecommended Requirement:Windows 7 64-bit2.0+ GHz multi-core processor4 GB System RAMATI RADEON 2000 / NVIDIA 8000 series or higher graphics card4GB hard drive spaceControl LoopNoYesDeath/ Victory-Next levelBeginInitializeGameInitializeScreenInitializeLevelInitializeCharacterIn puzzle screen?InitializePuzzle GUIInitializeCombat GUIPlayer ControllerAI ControllerLevelEnd LevelQuit GameEndDetailsInitialize GameInitializes variables for the overall game, grab all value that is needs to be loaded before the setting is done such as story progression and difficulty. Mainly global settings.Initialize ScreenThis section will be the one responsible to initialize the start of the game on screen. It will show the respective screen upon user choice depicted on the screen. Also will initialize the Menu Objects such as volume and screen resolution. Will have separate screen for different purpose in accordance to user input.Main Menu – this screen will depict the option where player is allowed to move to other screen or quit the game.Game Option Screen – this screen will display values of game settings such as difficulty levelSystem Settings Screen – this screen will display the value of the menu objects such as volume and screen resolution.Credit Screen – the screen where the group member information will be displayed.Initialize Level, Combat GUI, CharacterThe game environment will be initialized. The stage background and props that makes up the level then the GUI display that indicates health and progress, the character model will also be initialized. In LevelThe whole game process will be monitored now. Each function will be handled by each responsible thread. BattleGUI will be handled after the remaining thread has been handled.PlayerController, handle the player character action such as moving and playing animation. AIController, handler of various monster characters in the levelLevel, this will handle the state of the battle, adjust the camera lookAt target and position.BattleGUI, the handler for the GUI display that handle changes in health bar progress counter.PuzzleGUI, the handler for GUI display of puzzle pieces and controls used to handle the puzzle piecesPause ProcessWhen paused, the In Game Process will be forced to freeze. After that the initialize screen will take the control again and display the pause screen and any screen that might be accessed from mand List – this screen will display the command with its each corresponding key.End ProcessAs the battle ended, the In Game Process will be stopped. Again the initialize screen will take over and display the in between screen that might be displayed between the stage before again back to the initialize the stage again.Game Object DataReferenceObject NameTypePurposelevelIdintindicate the current levelIdlevelStringString to hold the current levelIdcurrentDifficultyGameDifficultyvariable to store current Game difficultyprogressintindicate the number of puzzle pieces collected as progressisLoadingLevelbooleanflag to determine whether the level component has all been initializedloadingScreenString[]String to store the list of loading screenactiveScreenTexture2Dvariable to store current active loading screenblackScreenTexture2Dvariable to store black screen to used together with loading screenloadingActivebooleanflag to determine whether the display the loading screen or notnextStageintvariable to store the ID of the next stage in story mode the value is obtained from scriptisRetrybooleanflag to indicate whether current round is a retry of the previous roundaudioVolumefloatindicate the current game sound volumeFunctionParameterPurposeChangeLevel(int, GameType)selected, gameTypefunction to set the next level and game typeChangeScene()voidfunction to change the scene to the one indicated in levelIsLevelOver()voidfunction to check whether the current stage is overSetNextLevelFromScript(String)lineset current and next level information from line LevelObject NameTypePurposecombatGUIcombatGUIvariable used to store GUI objectplayerStartLocationTransform[]indicates the spawn location of playerplayerCharacterGameObject[]indicate the game object of characterplayerControllerAddedboolean[]flag to indicate that the Controller class has been addedlevelStateLevelStatevariable to store current level stateprerequisiteStatebooleanflag to indicate that the Level State is allowed to changegravityfloatindicate the gravity value for the current levelstageBGMGameObjectindicate the game object that store BGM musicstartBattleBGMGameObjectindicate the game object that store BGM for win, lose and prebattle musicwinningBGMGameObjectindicate the game object that store BGM for win, lose and prebattle musiclosingBGMGameObjectindicate the game object that store BGM for win, lose and prebattle musicisPausedbooleanflag to indicates that game is pausedFunctionParameterPurposeClearLevel()voidget rid of all leftover game object in the levelPauseGame()voidfunction called when pausing the game to temporarily shut down some functionalityResumeGame()voidfunction called when resuming the game to set the functionality back to defaultenum LevelStatenamevalueMainMenu0Level 11Jigsphere 12Level 23Jigsphere 24Level 35Jigsphere 36CharacterObject NameTypePurposeplayerhealthfloatindicates the object current healthmaxHealthfloatindicates the object maximum healthspeedfloatindicates the character current movement speedrollSpeedfloatindicates the character roll speedjumpHeightfloatindicates the character jump heightdefaultJumpHeightfloatindicates the character default jump heighttargetYOffsetfloatindicates the offset of character center from the rootcontrollerTagOffsetfloatindicates the offset of controller tagidleAnimationSpeedfloatindicates the idle animation speedwalkAnimationSpeedfloatindicates the run animation speedjumpPoseAnimationSpeedfloatindicates the jump animation speed rollAnimationSpeedfloatindicates the roll animation speedFunctionParameterPurposeTakeDamage (float)damagefunction called when weapon projectile hit characterCameraObject NameTypePurposerotateCenterVector3the point of the lookAt target of the cameratestDividefloatthe divide value as to determine offsetX valueoffsetXfloatthe offset of the rotateCenter to the camera in x axishighestPointfloatindicates highest player character position in y axislowestPointfloatindicates lowest player character position in y axisoffsetYfloatthe offset of the rotateCenter to the camera in y axisdistancefloatthe distance value for the camera and the 0 z axisminOffsetZfloat[]indicates minimum offset camera position in z axis ([0] for 16:9 ratio, [1] is for 4:3 ratio)maxOffsetZfloat[]indicates maximum offset camera position in z axis ([0] for 16:9 ratio, [1] is for 4:3 ratio)zoomSpeedfloat[]indicates camera zoom speed ([0] for 16:9 ratio, [1] is for 4:3 ratio)offsetZfloatindicates the offset of the rotateCenter from 0 z axisfieldOfViewfloatindicate the value of the fieldOfView of the cameraaspectRatioint0 for 16:9 ratio and 1 is for 4:3 ratiocameraStateCameraStateindicates the state of cameratargetTransformindicates the object camera is looking atoldMousePositionVector3indicates the last known position of mouserotateSpeedfloatindicates the camera position speeddurationfloatindicates the duration for the cinematic stateisGameOverbooleanflag to indicate that game is overFunctionParameterPurposeSetEndGame()voidfunction to set the camera for end game stateSetTarget(int)idfunction to set camera targetControllerObject NameTypePurposeidleAnimationAnimationClipindicates the character idle animationrunAnimationAnimationClipindicates the character run animationjumpPoseAnimationAnimationClipindicates the character jump animationkbAnimationAnimationClipindicates the character knocked animationidleAnimationSpeedfloatindicates the idle animation speedrunAnimationSpeedfloatindicates the run animation speedjumpPoseAnimationSpeedfloatindicates the jump animation speed kbAnimationSpeedfloatindicates the knock back animation speed_animationAnimationvariable to store animation clipmoveDirectionVector3indicates the character moving direction previousYfloatindicate the y axis value in the previous frame stuckCountintindicates the stuck count in y axis stuckLimitintindicates the stuck limit for stuck countcontrollerCharacterControllerindicate the character controller componentcontrollerTagGameObjectvariable to store the controller tag game objectactivePlatformtransformDetermines if platform is activeactiveLocalPlatformPointVector3Stores the local location of the platformactiveGlobalPlatformPointVector3Stores the global location of the platformlastPlatformVelocityVector3Stores the last velocity of platform_characterStateCharacterStateenum state that indicate character stategravityfloatindicate the current level gravity that will affect the characterisGameOverbooleanflag to indicate whether the game is overisControlledbooleanflag to indicate whether the character is capable to be controlledisKnockbackedbooleanflag to indicate whether the character is currently knockbackAlivebooleanStores whether the character is aliveFunctionParameterPurposeApplyGravity()voidfunction called in every update to apply gravityAnimationChanger()voidfunction called every update to play the animation in each stateKnockback(Vector3)directionfunction called everytime a the character is hitMoveX(float)directionfunction called to move the character in x axisJump()voidfunction called to make the character jumpUpdateMovement()voidfunction called to update the position of the characterFunctionParameterPurposeenum CharacterStatenamevalueIdle0Walking1Running2Jumping3Rolling4Knockbacked5AIControllerObject NameTypePurpose_AIStateAIStateindicates the current AI state _AIAttackingStateAIAttackingStateindicates the current AI attacking statetargetGameObjectindicates the AI opponentdistancefloatindicates the distance between AI and opponentheightfloatindicates the height between AI and opponentmovementfloatindicates the direction of movementneutralFrequencyfloatindicates the frequency of neutral stateattackingFrequencyfloatindicates the frequency of attacking statedefendingFrequencyfloatindicates the frequency of defending stateFunctionParameterPurposeSetTargetPosition()voidfunction called to check the target positionCheckAvoid()voidfunction called to check whether the distance is to closeCheckDistance()voidfunction called to check the distanceCheckHeight()voidfunction called to check the heightSetDifficulty()voidfunction called to set the AI difficultyCheckFrequency()voidfunction called to set the AI attacking state frequencyenum AIStatenamevalueIdling0Closing1Avoiding2enum AIAttackingStatenamevalueNeutral0Attacking1Defending2JigSphereGuideObject NameTypePurposepieceSelectedstringindicates the piece selected targetNamestringindicates the target locationselectedbooleanStores if selectedcorrectMatchbooleanIndicates if the match is correctclearedbooleanindicates if the stage is clearedreferenceMasterScriptReference to the masterscriptpieceCounterintNumber of piecesJigSphereMainSPhereObject NameTypePurposespeedRotationfloatStores the speed of rotation guideJigSphereGuideReference to JigSphereGuidereferenceMasterScriptReference to masterscriptJigSphereMainSPhereHoverObject NameTypePurposeselbooleanindicates the selection guideJigSphereGuideReference to JigSphereGuidefinalMaterialMaterialStore the material for piecesfinalizebooleanIndicates if the sphere is finalizedJigSpherePieceControlObject NameTypePurposemaxOffsetfloatindicates the max camera offset curOffsetfloatindicates the cur camera offset minOffsetfloatindicates the min camera offset inSpherebooleanindicates if the piece is in the sphereselectedbooleanindicates the piece selectedprevSelectedbooleanStores the previous selected pieceguideJigSphereGuideReference to the JigSphereGuidespeedRotationfloatStores the speed of rotationupDownSpeedfloatDetermines the scrolling speedGame Physics and StatisticsControllerA class designed to manage all physics related to character movement whether it is from player input or because of combat resolution. These are the cause that will trigger any effect in the movement physics.Walk (‘w’ / ‘a’ / ‘s’ / ‘d’ key)Walk will trigger the movement of the character using the speed as a major variable that affect how fast the character move. moveDirection.x means that the character movement will only be affected in x axis and the movement variable value is obtained from the Unity Input.GetAxis("Horizontal") with value between -1 to 1 (-1 indicate left and 1 indicate right). AI is using a whole another method to obtain the movement value. Another thing to note is that while the character !isGrounded the movement will try to restrict itself as not to move faster that it usually is on ground.Roll (‘Shift’ + ‘w’ / ‘a’ / ‘s’ / ‘d’ key)Roll is done using another type of movement function from Run.Jump (“space” bar)Jump is done by giving a direct value of jumpHeight from Character class to moveDirection.y in contrast to Run and Dash which works with x axis. The value will then decrease bit by bit resulting from gravity which is obstructing any further movement in positive y axis and force the character to fall down.GravityGravity will always be applied to a character unless the character is in a special state isInvincible where the character won’t be affected by it resulting in flying.KnockbackResulted by combat resolution where the character will be knocked back for each time a character is hit.Object CollisionUsing built in physics in unity a character won’t overlap with another model with rigid body component applied to it.CameraCamera class calculates characters position and current game resolution to update its lookAt target and position. The camera will continuously move around as the characters move. The camera position will be the position of that lookAt target with a specific offset value for each axisAI – Artificial IntelligencePath FindingPath finding in the game is simple, since the gameplay of this game let the monsters guard a diameter of aggravate range. Movement StateThe AI movement state is divided into three categories that are idle, closing or avoiding. The character will stay at each state for a short period of time that is randomly decided by timer. But the frequency of changing state is different in each state. Idle will always change to either closing or avoiding after the timer is finished. While closing will allow a probability of advancing further when the opponent is still quite a distance away from it. After the closing timer is finished the state will check whether the AI is too close to the opponent. If it does it will then change to avoiding state.In avoiding state the character will move a distance away from the opponent and will check it again before deciding to keep avoiding the opponent or gone idle.Attacking StateThe AI attacking state is divided into another four states that are neutral, attacking, defending or recharging. The unlike the movement state which made the decision based on opponent distance the attacking state is all decided by frequency such as 20% idle, 60% attacking and 20% left for defending. The rate of frequencies will change accordingly by the amount of health. Recharging works in a bit of different way than the other; it will ignore the attacking state attacking frequencies and change the state into a full defending state to preserve mana. The AI difficulty will also set the frequencies of the AI attacking state.AI Attacking State Frequency ListEasy ModeHealthNeutralAttackingDefending> 700.40.60.0< 700.30.60.1< 500.30.50.2< 300.20.50.3Normal ModeHealthNeutralAttackingDefending> 800.30.70.0< 800.250.650.1< 700.20.60.2< 500.20.50.3< 300.10.50.4Hard ModeHealthNeutralAttackingDefending> 800.30.70.0< 800.20.70.1< 700.10.70.2< 500.10.60.3< 300.00.60.4MoveX(direction)Movement in x axis, the AI will only give the direction to the function and for as long the direction is not 0 the character will keep moving, the direction is acting the same way as the manually input Input.GetAxis("Horizontal") from Unity. Since it is not manually controlled it should be noted that a bumper function to reduce the speed bit by bit use to slowly stop the character from running is necessary.Target SelectionAI will always target the player when it is within sight or is attacked by the player.Reaction/BehavioursIf player is not in rangeClosing stateAttacking stateIf player is in rangeAvoiding stateAttacking stateIf health is low Attacking stateAvoiding stateArt & VideoGraphics EngineAll models will mostly be in lwo format for non-movable object and lws for moveable object, converted to .fbx format with bones unless specified, to represent character avatars, their properties, and their weapon. Model will be loaded inside the Unity Asset to the level with pre conditioned movement behavior attached to each of the model. Sprites for each character are in 2D targa format imported to the Unity Asset folder. Collisions for the models are within bounding box determined from the Editor.Artist InstructionsTextures used in model are all pre-attached within the models itself. If Unity fails to load the textures, a separate texture will be provided in a way that the model automatically reads the texture instantly when they were place in the same directory for the models. The size of the textures should be in 32 bit/24 bit depth with size of a minimum 300x300 resolution of .tga format.Level Specific CodeExcept for the Camera calculation function the dungeon is fixed so there will be less specific code, provide that:Platforms – at the start of the battle level it stays in one place until the end, fixed allocation placement code. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download