Table of Contents
回复内容:
Home Backend Development PHP Tutorial 手游开发Python和php哪个更快速呢?

手游开发Python和php哪个更快速呢?

Jun 06, 2016 pm 04:43 PM
php python

先介绍本人以前工厂工人, 后来自学做过单片机, 目前涉及手游 cocos2d-x. 但是网络方面的知识匮乏, 现在我们团队打算做网络的手游, 程序只有2名, 都是前端, 后台知识需要重新学.
问了很多的朋友, 有人说使用 Python 的, 有人说使用 php 的. Python 据我了解有一个叫 Firefly 的游戏服务器引擎, PHP 就不知道了.
对了, 我们的游戏主要以短连接为主. 其实我们的需求就是一个能够比较快上手适合做服务器端的语言. 请教下哪个语言比较适合我们现在的情况?
其实我个人比较喜欢Python, 名字很酷, 有没有什么框架可以介绍呢?

回复内容:

PHP要写好,不是一般的难,常常要从整体框架上做一些改动,而且得有一个项目级别的大牛牵头写,否则很容易写成学生级别的项目(好像别的语言也多少有点,但是PHP表现太突出了这点)
至于通讯方面,php有swoole这类的长连接server socket能做到一定的缓解,次一点的可以用rest接口,高并发node.js 都不是个事,根据项目而定。
至于什么nosql 负载均衡等等严格说跟语言没多少关系,所以还是看项目的资源来决定。
站在一个多年PHPER的角度,我只能告诉你:PHP做产品 demo易出,精品难寻。 Python没必要了, 现在大蟒的程序员都跑Golang的船上了

题主敢不用PHP呢, 那么好的语言(笑)
PHP人好招, 开发容易, 库又丰富, 对接方便. 还有啥不好的 PHP比python好用。曾经是Python程序员,python就是优雅就是绕,PHP就是简单直接。
对于说PHP不能做socket的人,请参考这里 matyhtf/swoole · GitHub
PHP写Server很简单,而且很强大。 用php做手游后台的非常多,很多成名手游是用php做后台 作为一个3年PHP经验的程序员,我的建议就是:
如果你追求快速快速开发,招人简单,用PHP是非常不错的。但是,如果你预计你的项目以后会做得很大,需要代码更好,选择其他语言吧。不一定是python,因为你将一个项目的语言定死,那么这个项目的局限性就太多了。队列这一块用nodejs、业务逻辑可以用python,ruby也不错哦,前端通信用nodejs的有一个html5通信框架(名字我忘记了),反正选择很多啦。数据库呢,redis做热点数据,mongodb做持久化存储,或者其他什么什么的。
说得太复杂了……总之就是,在开发进度和项目框架级别上做一个均衡。先用PHP做没问题的,PHP可以胜任很多事情,虽然某些时候他的表现会很糟糕。 必须php,推荐CI框架,配合nginx+mysql+redis。

nodejs的通信框架是socket.io,网易有一个基于socket.io的游戏框架。websocket,socket,http都有很好的支持。

php的类socket.io有一个swoole,上手简单。 如果楼主图快, 应该是找个会做的人来做(Java的 Python的 甚至Erlang的)
如果资金匮乏要自己搞, 那也就是自学网络编程(Java的 Python的 甚至Erlang的)
否则
你用php做, 那后面呢
要么项目死了
要么项目做起来了, 死在php要重构上....

不是说php养不活, 而是php要满足现有的游戏发展需求 速度慢难度大,
你能招到的php程序员应该大多数也只是web应用级别的
如果游戏是简单的需求用REST服务器就能搞定的话还好
但是之后呢.
升级了php还方便么还容易么 还能招到会做的能做的么

正如王海所说的, demo可以(某些类型demo都未必可以), 正式项目的话, 还是让php靠边站站吧
不要强调php可不可以, 要强调php合不合适 php做后端?我劝你如果没大牛还是别用php,erlang 要不就c++ lua必备。 参见:
推荐AppGyver等十大前沿移动应用开发工具

iOS开发者必备的五大编程类工具

推荐4项适用新手入门的游戏开发工具

介绍8款游戏开发工具

国外15种手机游戏引擎和开发工具介绍 我也建议使用PHP,因为高效简单,如果做到后期。真的遇到大流量处理的瓶颈,可以采用C++来做server。业务逻辑层,仍然推荐使用PHP来完成。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

How to control the size of XML converted to images? How to control the size of XML converted to images? Apr 02, 2025 pm 07:24 PM

To generate images through XML, you need to use graph libraries (such as Pillow and JFreeChart) as bridges to generate images based on metadata (size, color) in XML. The key to controlling the size of the image is to adjust the values ​​of the <width> and <height> tags in XML. However, in practical applications, the complexity of XML structure, the fineness of graph drawing, the speed of image generation and memory consumption, and the selection of image formats all have an impact on the generated image size. Therefore, it is necessary to have a deep understanding of XML structure, proficient in the graphics library, and consider factors such as optimization algorithms and image format selection.

Is the conversion speed fast when converting XML to PDF on mobile phone? Is the conversion speed fast when converting XML to PDF on mobile phone? Apr 02, 2025 pm 10:09 PM

The speed of mobile XML to PDF depends on the following factors: the complexity of XML structure. Mobile hardware configuration conversion method (library, algorithm) code quality optimization methods (select efficient libraries, optimize algorithms, cache data, and utilize multi-threading). Overall, there is no absolute answer and it needs to be optimized according to the specific situation.

Is there any mobile app that can convert XML into PDF? Is there any mobile app that can convert XML into PDF? Apr 02, 2025 pm 08:54 PM

An application that converts XML directly to PDF cannot be found because they are two fundamentally different formats. XML is used to store data, while PDF is used to display documents. To complete the transformation, you can use programming languages ​​and libraries such as Python and ReportLab to parse XML data and generate PDF documents.

How to open xml format How to open xml format Apr 02, 2025 pm 09:00 PM

Use most text editors to open XML files; if you need a more intuitive tree display, you can use an XML editor, such as Oxygen XML Editor or XMLSpy; if you process XML data in a program, you need to use a programming language (such as Python) and XML libraries (such as xml.etree.ElementTree) to parse.

Is there a mobile app that can convert XML into PDF? Is there a mobile app that can convert XML into PDF? Apr 02, 2025 pm 09:45 PM

There is no APP that can convert all XML files into PDFs because the XML structure is flexible and diverse. The core of XML to PDF is to convert the data structure into a page layout, which requires parsing XML and generating PDF. Common methods include parsing XML using Python libraries such as ElementTree and generating PDFs using ReportLab library. For complex XML, it may be necessary to use XSLT transformation structures. When optimizing performance, consider using multithreaded or multiprocesses and select the appropriate library.

How to convert XML files to PDF on your phone? How to convert XML files to PDF on your phone? Apr 02, 2025 pm 10:12 PM

It is impossible to complete XML to PDF conversion directly on your phone with a single application. It is necessary to use cloud services, which can be achieved through two steps: 1. Convert XML to PDF in the cloud, 2. Access or download the converted PDF file on the mobile phone.

See all articles