关于游戏中的实体系统 --- Component-Based Entity System

首先关于游戏实体,最早有这个概念是看了这篇文章---游戏Entity设计不完全整理

最早接触游戏编程的时候,看的是老师的代码,类似于早期的游戏,使用的是最传统的继承模式的实体系统。当时就觉得继承就是面向对象的一切,认为只要不断的继承就能解决所有问题。到后来才发现,继承的一个严重的缺陷是你必须知道所有父类的具体实现,到了最后一个实体也变得非常臃肿且难以修改。后来接触了设计模式,知道了策略模式这东西,大概的意思就是使用组合代替继承,个人认为组件模式更多的就是使用了策略。

总之,第一次接触组件模式的时候感觉很兴奋,认为一旦有了这种系统,无论策划怎么变,修改起来都是轻而易举的。于是立刻找了相关资料开始尝试实现,但是真正去实现之后才发现这玩意真不容易,越写越没思路,后来只能放弃。

后来跟一个朋友提起这个系统,然后他也尝试去弄了一下,相互交流之后感觉思路更开阔,不过苦于工作繁忙一直没时间再去弄,而且实际上对这个模式依旧是只有一个模糊的概念。其实期间一直在想办法找到可以参考的框架,那样就可以站在巨人的肩膀上去看组件模式。后来又接触了U3D,发现这玩意不正是组件模式的设计吗,于是迫不及待去看她的API,还去看了相关教程,然后就非常手痒的想实现一个看看。这时候公司说要做页游,于是就让我去搭框架,我第一个就想到了组件模式,而且第一个想法是直接复制U3D的那套。

虽然复制的话结果不需要想太多,但到了细节就不知道怎么实现了,比如实体具体该怎么创建,原型和克隆该怎么管理,最关键的是组件的动态添加和删除问题。虽然游戏中去给一个实体添加组

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Designing Software Product Lines with UML: From Use Cases to Pattern-Based Software Architectures 第二部分<br>Long a standard practice in traditional manufacturing, the concept of product lines is quickly earning recognition in the software industry. A software product line is a family of systems that shares a common set of core technical assets with preplanned extensions and variations to address the needs of specific customers or market segments. When skillfully implemented, a product line strategy can yield enormous gains in productivity, quality, and time-to-market. Studies indicate that if three or more systems with a degree of common functionality are to be developed, a product-line approach is significantly more cost-effective.<br><br>To model and design families of systems, the analysis and design concepts for single product systems need to be extended to support product lines. Designing Software Product Lines with UML shows how to employ the latest version of the industry-standard Unified Modeling Language (UML 2.0) to reuse software requirements and architectures rather than starting the development of each new system from scratch. Through real-world case studies, the book illustrates the fundamental concepts and technologies used in the design and implementation of software product lines.<br><br>This book describes a new UML-based software design method for product lines called PLUS (Product Line UML-based Software engineering). PLUS provides a set of concepts and techniques to extend UML-based design methods and processes for single systems in a new dimension to address software product lines. Using PLUS, the objective is to explicitly model the commonality and variability in a software product line.<br><br>Hassan Gomaa explores how each of the UML modeling views—use case, static, state machine, and interaction modeling—can be extended to address software product families. He also discusses how software architectural patterns can be used to develop a reusable component-based architecture for a product line and how to express this architecture as a UML platform-independent model that can then be mapped to a platform-specific model.<br><br>Key topics include:<br><br>Software product line engineering process, which extends the Unified Development Software Process to address software product lines<br><br>Use case modeling, including modeling the common and variable functionality of a product line<br><br>Incorporating feature modeling into UML for modeling common, optional, and alternative product line features<br><br>Static modeling, including modeling the boundary of the product line and information-intensive entity classes<br><br>Dynamic modeling, including using interaction modeling to address use-case variability<br><br>State machines for modeling state-dependent variability<br><br>Modeling class variability using inheritance and parameterization<br><br>Software architectural patterns for product lines<br><br>Component-based distributed design using the new UML 2.0 capability for modeling components, connectors, ports, and provided and required interfaces<br><br>Detailed case studies giving a step-by-step solution to real-world product line problems<br><br>Designing Software Product Lines with UML is an invaluable resource for all designers and developers in this growing field. The information, technology, and case studies presented here show how to harness the promise of software product lines and the practicality of the UML to take software design, quality, and efficiency to the next level. An enhanced online index allows readers to quickly and easily search the entire text for specific topics.<br>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值