31263 / 32004 Game Development

《算法设计与分析》全套PPT课件(哈尔滨工程大学) 立即下载

31263 / 32004 Game Development

Lab Week 6

Getting Started

1. Download the corresponding week’s zip file from this week’s module on Canvas.

2. Unzip the project folder and open it in Unity. If there are any warnings about difference in versions, just continue. If this causes any red errors in the console once the project opens, notify the tutor.

3. Within the weekly folders there are image and executable files starting with “Status…”. These files give you a preview of what is expected for each point percentage below.

a. If you are on Mac and the Status-100Percent App file won’t run, hold control and click (right click) then select Open, if there is a security warning, acknowledge it an press open again.

i. If you still have trouble, you may need to change the permissions of the file with the following command in a Terminal window: chmod -R +x Status-100Percent-Mac.app/Contents/MacOS

b. If you are running the Windows executable on the lab computers, you need to copy the entire executable folder into Windows(C:)/Users/<student number>/AppLockerExceptions.

From there you can double run the .exe file.

Tasks

Points                                                               Requirements

40%

• Open the project folder in Unity. Open Week6Scene if it is not already open.

• Create an empty GameObject called “Managers”.

• Open the TimeManager script. in the Scripts folder

• For every 1 second that passes, TimeManager should print the time since start of game as an integer seconds value.

o Tip: use a private member variable such as “int lastTime” to store the time value that was last printed. Then use Time.time in Update() to check if a full second has passed.

o Make sure that TimeManager starts printing from 0 (e.g. 0, 1, 2… etc).

▪ Tip: Consider an initial value of lastTime that would be overridden for Time.time = 0 in the first Update call.

• Attach TimeManager to the Managers gameobject.

There is no ProgressEvaluator for this week because it would give away the solutions to the activity. It is better for you to learn from a good challenge and check your own progress this week. Make sure you are looking at the Status-xPercent image files or ask your tutor to check your game is running as expected.

50% (P)

• In TimeManager, use Input.GetKeyDown(KeyCode) to detect when the Spacebar is pressed, which should do the following:

o Pause and unpause (tip: see Time.timeScale)

o Print to the console “Spacebar pressed”

o Note: Update() is still called but Time.time is no longer updated

60% (P)

• Instead of Time.time, change the code to use Time.deltaTime and a private variable called “timer”. Keep track of time by adding deltaTime to the timer (e.g. timer += Time.deltaTime;)

o The printing to console should still start from 0.

• On pressing the Enter (Return) key, the seconds timer should be reset to 0.

o The reset should take place in a new private method called ResetTime() to make this functionality easily re-usable. It should be called when the game starts and then whenever the Return key is pressed.

o ResetTime() should also reset all time related variables to their default values.

Reminder: Complete the COMPLETE-BEFORE-SUBMISSION.txt file before you submit. Otherwise, you will receive a mark of 0 .

70% (C)

• From the Prefab folder in the Project Window:

o Drag a RedPrefab into the Hierarchy Window, make sure the rotation is zeroed and set the position to (2,1,0)

o Drag a BluePrefab into the Hierarchy Window, make sure the rotation is zeroed and set the position to (-2,-1,0)

• In TimeManager:

o Create a serialized private Transform. array called transformArray. Select the Managers gameobject in the Hierarchy Window and change the size of the transformArray in the Inspector Window to 2. Drag the RedPrefab and BluePrefab instances from the Hierarchy Window into the array.

o Create a c# “constant” float member variable called “moveWait” and set it to 2.0f.

• From the Start() method of the TimeManager

o Change the camera view from “perspective” to “orthographic” (tip: see Camera.main and Camera.orthographic).

o Set the orthographic size of the main camera to 2.5f.

80% (D)

• In TimeManager, create a new private method called MoveObjects()

o Once every <moveWait> seconds on the timer, move the colored objects in a synchronized square clockwise manner (e.g. when the timer prints out as 2 the RedPrefab should pop to (2,-1,0) and the BluePrefab to (-2,1,0), then move again at 4 seconds).

o Challenge: Can you make it so that this movement can account for any starting positions of the two objects but assuming that there are only two objects to move and that they start with different x and y values? (not required, only for a fun and useful challenge)

▪ Rotation in this case is not around (0,0), but such that the red and blue gameobjects will be in each other’s initial positions after two MoveObject calls.

90% (HD)

• Create another const float called “scaleWait” and set it to 4.0f.

• Create the private method “ScaleObjects()” which should do the following to the transformArray elements:

o If an object’s local x scale value is greater than 1.5 then divide all scale values by 1.2.

o Otherwise, multiply all scale values by 1.2.

o Tip: see Transform.localScale

• In ResetTime(), use InvokeRepeating(…) to call ScaleObjects() once every <scaleWait> seconds.

• This behavior. should obey the Pausing and Reset functionality (tip: see CancelInvoke(…))

100% (HD)

• When the “Escape” key is pressed, TimeManager should generate a random value between (0.5, 1.0) and start the following coroutine (tip: see StartCoroutine()).

o “IEnumerator RotateObjects(float randomDelay){…}”

• This coroutine should wait for <randomDelay> seconds, then rotate the two game objects by positive 90 degrees around the z axis, then repeat 3 more times (e.g. wait-rotate-wait-rotate and so on. The objects turn a full 360 degrees before exiting the method) (tip: see WaitForSeconds(…))

• This should obey the Pausing functionality but not the Reset functionality (i.e. the objects should finish their full rotation).

• Try the Status-100% executables

o Press Escape to start the rotation

o Press Spacebar to pause the movement, scaling, and rotation

o Press Spacebar to un-pause everything

▪ If you do this a few times and your objects are rapidly changing size (i.e. not at 4 second intervals) then you are stacking Invoke calls (multiple scale invokes are running at the same time) and you need to go back and check the 90% section.

o Press Escape again and then Enter to reset the timer for movement and scaling but the rotation should continue

▪ If you press Escape multiple times and your objects are no longer rotating at even intervals or are popping back a forth between rotations then you are stacking coroutine calls – only one rotation coroutine at a time should be running.

• CLEAN, EFFICIENT, ELEGANT CODE!

Bonus

Submit your work on Canvas before continuing. Follow the instructions on the last page.

This part is optional. If you completed the above activity very quickly, try this. It is not graded, but it will enhance your skill.

• Merge you Week 5 solution into your Week 6 solution (or use the provided Week 5 Solution on Canvas instead)

• Remove the Update() methods from all of the Week 5 and 6 scripts

o Replace them instead with Coroutines that are started in Awake or Start.

o See if you can change the content of these so that they do the same thing as the old Update methods but in a different way.

• Note: This is definitely not a recommended thing to do!

o Do not re-invent the wheel – Unity already has a game cycle, you don’t need to make your own (a mistake a lot of people make when they first master Coroutines)

o However, this is a good exercise to show you the power of Coroutines and how all Unity Update() methods are essentially just Coroutines.

Submission

When you complete the activity to the grade threshold that you want, you then need to:

1. Evaluate your progress:

a. Make sure that you have run the “ProgressEvaluator” at the final band you achieved.

b. Not doing so is an indication that you are not evaluating and tracking your own learning.

2. Complete the plagiarism declaration:

a. Complete the “COMPLETE-BEFORE-SUBMISSION.txt” file in the highest level of the project folder.

3. Reduce file size:

a. Remove all files and folders starting with the “Status-…” prefix

b. Remove the “Library” folder

4. Preparing your zip file:

a. Zip the entire project folder.

b. Re-name the zip file to “[student ID]-LabWeek[week number].zip”.

5. Submit the zip file to Canvas for the associated link for this week in the Lab before Monday 9am of the following week.

6. Failure to follow any of these could result in a 0% mark for that week.

Delphi 13.2控件之msquic4d.rar 立即下载

相关推荐

openworker(Python)

「openworker(Python)」是开源项目(Python)。源码完整,下载解压即可查看使用,适合学习参考、课程设计与二次开发。

31263 / 32004 Game Development Lab Week 6

Java Python 31263 / 32004 Game DevelopmentLab Week 6Getting Started1. Download the corresponding week’s zip file from this week’s module on Canvas.2. Unzip the project folder and open it in Unity. If there are any warnings about difference in versions, jus

qq___99515681的博客 634

数字政府政务服务AI大模型赋能智能体平台及AI场景应用规划方案(决策评审版).pptx

数字政府政务服务AI大模型赋能智能体平台及AI场景应用规划方案(决策评审版).pptx

31263 / 32004 Game Development Lab Week 8Java

• Trigger:

ishttt33nt的博客 811

T18_低空经济示范区十五五通感一体化低空智联网与飞行服务保障体系设计方案_生态合作版.pptx

T18_低空经济示范区十五五通感一体化低空智联网与飞行服务保障体系设计方案_生态合作版.pptx

T04_城市生命线AI智能体平台及AI大模型应用场景规划方案_技术方案版.pptx

T04_城市生命线AI智能体平台及AI大模型应用场景规划方案_技术方案版.pptx

31263 / 32004 Game Development Lab Week 4R

Assemblies。

wolfminy的博客 676

EPLAN自动成图与报表实战合集 API批量成图脚本+端子表电缆表自动生成

内容概要:EPLAN自动成图与报表自动生成实战合集,含2篇原创:API批量成图脚本骨架(对象模型+可运行C#代码+三个必踩坑+42页从3.5小时压到11分钟实测)、端子表/电缆表/部件清单报表自动生成(配置逻辑+翻车点+提效数据)。适用人群:电气设计工程师、成套厂制图员、EPLAN二次开发。使用场景:图纸批量生成提效、报表自动化。原创整理。

31263 / 32004 Introduction to Game Development Assessment 3 and 4 Recreate a Classic GameStatistics

in2D,threescenes4. Allvisualdifferentinappearancetotheoriginalgameand theymustbeyourowndesigns6.Audio7. AllscriptsYouMAYNOTusetheextraTilemapAnimatedTileUnityProjectFiles:UnityProject。

priorityqueue2的博客 763

威百威9000V6商业管理软件-210930稳定版本

支持扫码支付

旋转中心标定诊断工具(视觉标定失败定位+Kasa圆拟合)

机器视觉旋转中心标定失败诊断工具:Kasa圆拟合求旋转中心+四类失败原因自动定位(标定点共线/旋转角步集中/拟合残差大/像素机器人映射方向反),含README与示例数据,仅依赖numpy,源自真实产线客诉排查经验。

【FDE知识库】(1):AI 编程时代开发语言选型分析,云使用go,企业用java,算法python,底层c

AI 编程时代,开发语言选型需综合考量AI适配度、编译速度、跨平台与学习成本。Python以海量语料和即时执行成首选,适用于AI/ML与原型开发;TypeScript凭借类型系统与秒级构建,成为前端及应用层主流;Go以极速编译与统一风格,契合AI代理高效迭代需求。Rust/C++虽性能强,但编译慢、学习成本高,不适于快速试错。综合推荐:优先选Python、TypeScript、Go,兼顾效率与生态,实现最优AI协作体验。

freewebsys的专栏 658

多目标粒子群算法求解综合能源系统最优容量配置研究(Matlab代码实现)

内容概要:本文研究了基于多目标粒子群算法(MOPSO)求解综合能源系统(IES)中最优容量配置的方法,并提供了完整的Matlab代码实现。研究旨在通过优化风电机组、光伏机组、燃气轮机、储能系统等多种能源设备的容量配置,实现系统在经济性、环保性和能源利用率等方面的多目标平衡。文中构建了综合能源系统容量配置的数学模型,明确了以最低综合成本、最小碳排放为核心的目标函数,以及能量供需平衡、设备出力能力等关键约束条件,并详细阐述了MOPSO算法的实现流程,包括种群初始化、非支配排序、拥挤距离计算和外部存档更新等核心机制。最后,通过Matlab平台的仿真实验验证了该方法的有效性,结果表明该算法能够生成分布均匀且具有良好多样性的Pareto最优解集,为决策者根据不同侧重点选择最终方案提供了科学依据。; 适合人群:具备一定电力系统、优化算法和Matlab编程基础的研究生、科研人员及工程技术人员。; 使用场景及目标:① 学习和掌握综合能源系统容量配置问题的建模方法;② 深入理解多目标粒子群算法(MOPSO)的核心原理及其在实际工程优化问题中的应用;③ 获取可直接运行和修改的Matlab代码,用于复现研究成果或进行二次开发。; 阅读建议:建议读者在阅读时,首先理解综合能源系统的背景和优化问题的数学建模过程,然后结合提供的Matlab代码,逐步跟踪算法的执行流程,重点关注目标函数和约束条件的代码实现,以及MOPSO算法中非支配排序和拥挤距离计算等核心模块。为了更好地掌握,可以尝试调整算例参数、增减优化目标或修改算法参数,观察结果的变化。

复现基于全局积分滑模控制(GISMC)的欠驱动自主水下航行器(AUV)水平轨迹跟踪控制研究(Simulink仿真、Matlab代码实现)

内容概要:本文研究了基于全局积分滑模控制(GISMC)的欠驱动自主水下航行器(AUV)水平轨迹跟踪控制方法,通过Simulink仿真与Matlab代码实现对该控制策略进行复现与验证。针对欠驱动AUV系统存在的模型不确定性与外部干扰问题,设计了全局积分滑模控制器,有效提升了轨迹跟踪精度与系统鲁棒性,克服了传统滑模控制存在的稳态误差与抖振问题。该控制器通过引入积分项增强了对持续干扰的抑制能力,并确保系统在整个状态空间内实现渐近收敛。仿真结果表明,在复杂海洋环境下,所提方法能够实现对期望轨迹的高精度跟踪,具备优良的动态响应性能与抗干扰能力,适用于AUV在水平面内的精确导航与控制任务。; 适合人群:具备自动控制理论基础、海洋工程背景或从事无人系统控制研究的科研人员,以及熟悉Matlab/Simulink仿真工具的自动化、船舶与海洋工程等相关专业的研究生与工程师。; 使用场景及目标:①用于解决欠驱动AUV在未知扰动下的轨迹跟踪控制问题;②为滑模控制在非线性、强耦合系统中的应用提供仿真验证案例;③推动先进控制算法在水下机器人系统中的工程化实现。; 阅读建议:读者应结合Matlab代码与Simulink模型进行仿真操作,重点关注滑模面设计、控制律推导与参数整定过程,建议在复现基础上尝试引入不同干扰条件或优化控制结构,以深入理解GISMC的控制机理与鲁棒特性。

PSO-LSTM基于PSO优化LSTM网络的电力负荷预测(Python代码实现)

内容概要:本文提出了一种基于粒子群优化算法(PSO)优化长短期记忆网络(LSTM)的电力负荷预测方法,并通过Python代码实现了完整的模型构建与仿真验证。该方法利用PSO算法全局寻优的能力,自动优化LSTM网络的关键超参数,如学习率、隐含层节点数、训练迭代次数等,从而克服传统LSTM依赖人工调参导致的预测精度不高和收敛速度慢的问题。文中详细阐述了PSO-LSTM混合模型的架构设计、算法流程及其实现细节,结合实际电力负荷数据进行了实验验证,结果表明该模型在预测精度、稳定性与泛化能力方面均优于标准LSTM及其他传统预测模型,尤其适用于短期电力负荷预测任务。; 适合人群:具备一定Python编程基础和机器学习理论知识,从事电力系统分析、能源管理、智能电网调度及相关领域研究的研发人员、工程技术人员及高校研究生。; 使用场景及目标:①应用于电力系统短期负荷预测,提升电网运行调度的科学性与经济性;②为能源管理系统提供高精度负荷数据支持,优化发电计划与资源配置;③作为智能优化算法与深度学习融合的教学案例,帮助学习者掌握PSO与LSTM协同建模的方法与实践技巧;④为后续研究提供可复现的代码基础和技术参考。; 阅读建议:建议读者结合提供的Python代码,动手复现整个建模与训练过程,深入理解PSO优化机制与LSTM网络结构的耦合方式,并尝试在不同时间尺度和负荷场景的数据集上进行迁移测试,以全面评估模型的适应性与鲁棒性。

基于粒子群优化算法的三方三层的主从博弈能源系统优化模型研究(Matlab代码实现)

内容概要:本文研究了基于粒子群优化算法的三方三层主从博弈能源系统优化模型,旨在通过Matlab代码实现对包含风、光、火、储等多种能源形式的综合能源系统进行优化调度。该模型构建了包含能源供应商、运营商与用户三类主体的多层次博弈架构,引入主从博弈机制,将不同参与者划分为领导者与跟随者角色,并在不完全信息环境下采用Epsilon纳什均衡策略实现多方利益协调。结合多目标粒子群优化算法,有效解决了系统运行成本、峰谷差与碳排放等多重目标间的权衡问题。研究进一步整合了需求响应与电能转气(P2G)等灵活性资源,提升了系统调节能力,并通过IEEE39等标准系统进行潮流计算与电能质量分析,验证了模型在提升综合能源系统经济性、稳定性与环保性方面的有效性。; 适合人群:具备电力系统、优化算法及博弈论基础知识的科研人员与研究生;从事能源系统优化、智能调度及相关领域研究的专业技术人员;有志于复现高水平期刊论文成果并开展创新性研究的硕博生。; 使用场景及目标:① 学习并掌握主从博弈在综合能源系统中的建模方法与求解流程;② 理解多目标粒子群算法在复杂能源调度问题中的应用技巧;③ 掌握需求响应、P2G等灵活性资源在系统优化中的集成方式;④ 借助Matlab代码复现IEEE39系统的潮流计算与电能质量分析过程,支撑科研项目或学术论文撰写。; 阅读建议:本资源以Matlab代码为核心载体,强调理论建模与仿真实践的深度融合。建议读者在学习过程中结合博弈论与智能优化算法的基础理论,逐步调试代码并分析关键参数的影响,重点关注Epsilon纳什均衡的实现逻辑与多目标优化的收敛特性,从而深入理解能源系统协同优化的内在机制。

主动配电网故障恢复的重构与孤岛划分统一模型研究升级版本(Matlab代码实现)

内容概要:本文针对主动配电网在故障情况下的恢复问题,提出了一种网络重构与孤岛划分的统一优化模型,旨在通过协同优化配电网的拓扑结构与分布式电源形成的可控孤岛,最大限度恢复关键负荷供电,提升系统韧性。该模型充分考虑了分布式电源出力特性、负荷分级需求以及配电网辐射状运行等多重约束,构建了以负荷恢复最大化和网络损耗最小化为目标的混合整数非线性规划问题,并采用高效的优化算法进行求解。研究通过Matlab编程实现了完整的模型求解与仿真验证,结果表明所提方法能有效协调重构与孤岛策略,显著提高故障后的供电恢复能力和系统运行的稳定性。; 适合人群:具备电力系统分析、优化理论及Matlab编程基础,从事主动配电网、分布式能源集成、电网韧性提升或智能电网故障恢复等相关领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于高比例分布式电源接入的现代配电网故障应急处置与恢复决策;②为提升电网应对极端事件的能力提供先进的理论模型与技术方案;③通过Matlab代码复现与仿真,深入学习和掌握配电网重构、孤岛划分及综合优化的前沿算法。; 阅读建议:建议读者结合电力系统潮流计算、图论基础和优化建模知识进行学习,重点理解模型中目标函数的设计理念、各类物理约束(如潮流、辐射状、孤岛连通性)的数学表征方法,以及求解算法的实现逻辑。务必动手运行并调试所提供的Matlab代码,通过改变网络参数和故障场景来探究模型的适应性和性能边界。

2026年AI编程工作流实战:Claude Code与Open Code深度对比

AI编程已从代码生成工具升级为IDE级智能工作流核心能力。其本质是将大语言模型深度嵌入开发环境,通过语义理解、上下文感知与行动闭环重构传统编码范式。Claude Code以企业级知识图谱和双轨Code Review为代表,强调合规性、可审计与深度集成;Open Code则依托Skill可组合性、本地优先模型与ocp协议,实现开源驱动的灵活扩展。二者共同推动IDE从‘编辑器’进化为‘数字搭档’——能理解RFC文档、记住PR评论、自动补全带重试的fetch逻辑,并在Promise链发呆时一键重构为async/a

weixin_33739523的博客 476
上一篇: FIT9132 Introduction to Databases
下一篇: FIT1054 - Fantasy Football League
vx___codinghelp
博客等级 码龄2年 778粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值