(游戏引擎)框架设计

发布于 2024-08-09 19:31:00 字数 702 浏览 1 评论 0原文

我目前正在研究 2D 浏览器游戏。

ZendFramework 收起后,我和我的团队决定编写我们自己的框架。

现在我们很无奈,因为我们没有人开发过类似的东西,除了CMS框架等。

语言是PHP,使用的数据库驱动程序是MySQL(i, PDO 等)

您能给我们一些关于构建框架的建议吗?

谢谢 ;)

应该适合的类型示例

  • 奥加梅
  • 特拉维安
  • 扎伦瓦尔

(我的)要求(对框架)

  • 基本 API
  • 没有太多我无法处理的功能, 我不需要

我对(我的)框架的想法

  • 某种“后端
  • 管理数据库
  • 处理注册、HTTP 请求
  • 产生游戏中某事发生或不发生的可能性
  • 没有图形机制,只是计算收入、白天、伤害 坦克 xy 等

顺便说一句,我测试的框架不是php游戏引擎,因为我从未发现任何免费可用的php游戏引擎。

I am currently working on 2D browser game.

After putting the ZendFramework away, my team and I decided to write our own framework.

Now we are helpless, because none of us has ever developed anything similar, except CMS frameworks etc.

The language is PHP and the database driver used for it is MySQL(i, PDO, etc)

Can you give us any tips about structuring the framework?

Thank you ;)

Example of the genre the should fit in

  • Ogame
  • Travian
  • Zarrenwar

(My) Requirements (to the framework)

  • Basic API
  • No overwhelming amount of functionality, which I can not handle,
    and I do not need

My idea of (my) the framework

  • Some sort of "backe-end"
  • Managing the database
  • Handling registrations, HTTP requests
  • Generating chances that something ingame will or will not happen
  • no graphical mechanisms, just computing income, daytime, damage of
    tank xy, etc.

By the way, the frameworks I tested were not php game engines, because I never found any php game engine freely available.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

独行侠 2024-08-16 19:31:00

我认为您真正需要的是一个 javascript 游戏引擎,因为单独的 PHP 无法为游戏中的 2D 交互(移动精灵、改变分数等)提供太多帮助。也许看一下几个 javascript 游戏引擎之一,例如:

和其他几个很容易找到的...

i think what you are really looking for is a javascript game engine, as PHP alone isn't going to provide much to help with in-game 2D interaction (moving sprites, changing scores, etc). Maybe take a look at one of the several javascript game engines like:

and several others which are pretty easy to find...

阳光①夏 2024-08-16 19:31:00

您编写自己的框架的原因是什么?您确定要将精力转移到重新发明轮子上(这可能会成为一个混乱的过程,因为您似乎没有太多经验)?一个干净、稳定的框架是任何项目的基础,如果你必须一直修复它,那么依赖它的项目将遭受严重损失。为什么不选择一个支持良好且可以获得社区支持的开源框架呢?

相信我,对于实际的浏览器游戏,您将有足够的工作要做。 :)

What are your reasons for writing an own framework? Are you sure you want to divert your energy to re-inventing the wheel (which is likely to become a messy process, as you do not seem to have much experience)? A clean, stable framework is the groundwork of any project and if you have to fix that all the time, the project relying on it will suffer horribly. Why not choose a well-supported open source framework for which you can get community support?

Believe me, you will have enough work to do with the actual browser game. :)

波浪屿的海角声 2024-08-16 19:31:00

PHP 不具备任何制作图形游戏的能力,因为它可以动态创建精灵,但它运行在服务器端,所有操作都在浏览器上进行。

因此,您的游戏引擎需要位于您进行图形处理的一侧。

您可能想为世界编写一个框架,以便多个用户可以体验同一个世界,并相互影响,在这种情况下 PHP 就可以了,因为它只是保留世界的模型并确定发生了什么。

因此,无论您在浏览器上使用什么来显示图形,很可能已经有一个为其开发或正在开发的游戏引擎,因此您可能需要写下对游戏引擎的要求,然后可以问这个问题:我有这些要求,并查看了这些游戏引擎(由于这些原因我拒绝了这些引擎),什么引擎可能最适合我的需求。

如果您不仅能了解您的需求,还能了解您在给出建议之前拒绝某些引擎的原因,那就太好了。

PHP is not going to have any capability for doing a graphic game, as it could create sprites on the fly, but it runs on the server-side, and all the action is on the browser.

So, your game engine needs to be on the side where you are doing your graphics.

You may want to write a framework for the world, so that multiple users can experience the same world, and affect each other, in that case PHP would be fine, as it would just be keeping a model of the world and determining what happened.

So whatever you are using on the browser to show the graphics will most likely already have a game engine either developed or being developed for it, so you may want to write down your requirements for a game engine and you can then ask that question: I have these requirements, and having looked at these game engines, which I rejected for these reasons, what engine may be best for my needs.

It would be nice to know not only your requirements but why you rejected some of the engines out there before giving suggestions.

夏夜暖风 2024-08-16 19:31:00

我不太确定您想要什么样的游戏,但 PHP 本身并不是编写游戏 2D 方面的正确编程语言或技术。

您声称拥有 CMS 经验,这很好,因为这可以用于/适应 CRUD 游戏状态和实体。

但对于图形,请考虑使用 Flash 或类似技术。 Mabye 只是简单的 javascript 和新的 html5 canvas 以及一个 php 后端。

至于框架,虽然我没有使用任何框架的经验,但有很多用于 Flash 的框架,简单的 google 搜索就可以发现许多针对 javascript 游戏引擎的活跃实验和研究。

I'm not quite sure what kind of game you have in mind, but PHP in itself is not the right programming language or technology for writing the 2D aspect of the game.

You claim to have experience with CMSes, which is good, because this can be used/adapted to CRUD game state and entities.

But for the graphics, consider using Flash or similar technologies. Mabye just plain javascript with the new html5 canvas, and a php backend.

And about frameworks, although i do not have experience with any of them, there are plenty for flash and a simple google search revaels lots of active experiments and research for javascript game engines.

属性 2024-08-16 19:31:00

如果您想开发自己的框架,我建议您首先使用现有框架开发几个游戏,利用您的经验了解哪些内容有效以及您的真正需求是什么,然后使用这些知识开发您的框架。我的猜测是,这比从头开始开发框架要快。

但我认为你真正想要的是开发一款游戏,并且你认为开发自己的框架比找到现有的并尝试过的框架并学习使用它更快。我说得对吗?

If you want to develop your own framework, I suggest you first develop a couple of games using existing frameworks, use your experiences about what works and what your needs really are, and then develop your framework using that knowledge. My guess is that that would be faster than developing a framework from scratch.

But I think what you really want is to develop a game, and you think that developing your own framework would be faster than finding an existing and tried framework and learning to use it. Am I right?

眉目亦如画i 2024-08-16 19:31:00

我曾经用 PHP 制作了一个游戏,一个策略游戏,我结合了 JQuery (JS) 和 PHP,虽然我仍在研究它,但我会开始制作类和函数(提示:使用 OOP),完成后,制作游戏。

  1. OOP 框架(类和函数) - 1 天/2 个月
  2. 图形 - 2 天/5 个月
  3. 时间线和游戏界面 - 1 个月/1 年

--------- 总计:最多。 1 年零 7 个月 - 最短1个月零3天---------

该时间只是制作系统所需的平均时间。

祝你好运 :)

I once made a Game in PHP, A strategy game, I combined JQuery (JS) and PHP, Im still working on it though but I would start making Classes and Functions (TIP: Use OOP), After finish, Make the Game.

  1. OOP Framework (Classes and Functions) - 1 Day / 2 Months
  2. Graphics - 2 Days / 5 Months
  3. Timeline and Game interfaces - 1 Month / 1 Year

--------- TOTAL: MAX. 1 Year and 7 Months - MIN. 1 Month and 3 Days ---------

The time is just the Average time it takes to make the System.

Good luck :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文