虚幻引擎简介

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

GameProgramminginUE4GameFramework&SampleProjectsGerkeMaxPreussnermax.preussner@epicgames.comGameFrameworkHistoryUE1andUE2•DesignedforFirstPersonShooters(FPS)•UnrealScriptgamescriptinglanguageUE3•KismetVisualScriptingadded•Moremodulargameclasses•ButstillveryFPScentricUE4•UnrealScriptreplacedwithBlueprints•Gamegenreagnostic•Lotsofsampleprojects!UnrealScriptvs.C++vs.BlueprintsUnrealScriptwas:•Anobject-orientedscriptinglanguage•SimilarinsyntaxtoC,C++,Java,butalsosomewhatdifferent•Compiledtovirtualmachinebytecode•Addinginterestingfeatures,suchasStates,Timers,DelegatesBlueprintsare:•Avisualscriptingsystemthatisartistanddesignerfriendly•UsingthesamevirtualmachineasUnrealScript•AlmostaspowerfulasUnrealScript,andinsomewaysevenbetterC++has:•AlwaysbeenpartofUEgameprogramming•Tightbi-directionalintegrationswiththevirtualmachine•BeengreatlyimprovedinUE4toreplaceUnrealScriptforcodersC++BlueprintsVMSoWhatIsTheGameFramework?OverviewWhyUseIt?SetOfFoundationClasses•Providebasicstructureandfunctionsofyourgame•Youderivefromtheclassesthatyouneed•FillinthedetailsforyourparticulargameWhat’sMissing?•Gamegenrespecificimplementations•Noconceptofhealthanddeath•Nobuilt-inclassesforweapons,inventory,etc.SoWhatIsTheGameFramework?OverviewWhyUseIt?ReducedLearningCurve•Hidesthelow-leveldetailsofgameengines•Benefitfrom20+yearsofgamedevelopingexperience•ManysamplesandtutorialsforsolvingcommontasksHighProductivity•Focusonwhatreallymatterstoyou:makingyourgame•Solvesmanytrickyproblemsingames(movement,input,etc.)•GreatlyreducesboilerplatecodeneededforallgamesScalability•Smoothlygrowyourgame&teamfromprototypetoAAAFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisanActor?•Entityinagamelevel•UsuallycontainsoneormoreActorComponents•SupportsnetworkreplicationformultiplayergamesThingstoknowaboutActors•Don’thaveLocation,Rotation(storedinrootcomponent)•CreatedwithSpawnActor()method•MustbedestroyedexplicitlywithDestroy()method•WillnotbegarbagecollectedduringthegameFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisanActorComponent?•ReusablefunctionalitythatcanbeaddedtoanActor•Containthemostinterestingfunctionality&events•AlsoaccessibleinBlueprints!ExampleComponents:•SceneComponent–Addstransformsandattachments•PrimitiveComponent–Addscollisionandrendering•UAudioComponent,UArrowComponent,UInputComponent,ULightComponent,UMeshComponent,UParticleSystemComponentandmanymore!FundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModePrimiviteComponentEventExamples•Hit–Calledwhenbumpingintoawall•Begin/EndOverlap–Walkintooroutofatrigger•Begin/EndCursorOver•Clicked/Released•InputTouchBegin/End•Begin/EndTouchOverFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisaPawn?•Anagentintheworld•OptionallypossessedbyaController•UsuallyhandlesmovementandinputThingstoknowaboutPawns•Goodplacetoimplementhealth•NomovementorinputcodebydefaultFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisaController?•AbrainthatcanpossessaPawn•PlayerController:Representsahumanplayer•AIController:ComputesAIbehaviorforPawnsThingstoknowaboutControllers•PossessonePawnatatime•CanpersistafterpossessedPawndiesFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModePlayerController•Interfaceforplayerstoagents•Handlestouches,clicks,keyboard•Showing/hidingmousecursor•Goodplacefornon-agentcode•Menus,voicechat,etc.•ManyotherusefuloptionsFundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisaCharacter?•SpecialPawnthatcanwalk•ComeswithusefulComponentsThingstoknowaboutControllers•Handlescollision•Client-sidemovementprediction•MuchimprovementfromUE3FundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisaHUD?•Head-UpDisplay•Responsibleforin-gameUIThingstoknowaboutControllers•Immediate-modedrawingAPI•NotoolsforbuildingHUDs•UMGwillprovideallthethings!FundamentalConceptsActorsComponentsPawnControllerCharacterHUDGameModeWhatisaGameMode?•Implementsthegamerules•ConfiguresdefaultclassesforPawn,Controller,HUD,etc.•Canbeaccessedfromanywhere(GetGameMode())ThingstoknowaboutGameModes•Onlyexistsontheserverandsingleplayerinstances!•GameStateisusedtoreplicategamestatetoclients•DefaultgamemodecanbesetinProjectSettings•Per-mapoverridesinWorldSettingsOtherImportantConceptsInputCollisionReplicationAxes&Actions•Canbindtomouse,keyboard,touch,etc.•DefinedinProjectSettingsInputProcessingOrder1.PlayerController2.LevelBlueprint3.PossessedPawnOtherImportantConceptsInputCollisionReplicationVariousCollisionQueryFunctions•Linetraces(raycasts)•Geometrysweeps•OverlaptestsSimpleCollision•Box,sphere,capsule,convex•AuthoringtoolsinEditor•Usedformovement,physics,etc.Complexcollision•Actualgraphicstriangles•Usedforweapons,kinematics,etc.OtherImportantConceptsInputCollisionReplicationTransfergamestatebetweenServerandClients•RemoteProcedureCalls(RPC)•Datatransfer(variables,structs,dynamicarrays)•EditorsupportsmultiplayerPIEtestingGameFrameworkFlowchartQuestions?Documentation,TutorialsandHelp

1 / 19
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功