Using PHP framework for PBBG - worth or no?

C++, C#, Java, PHP, ect...
Post Reply
leruman
Posts: 29
Joined: Fri May 25, 2012 6:06 pm

Using PHP framework for PBBG - worth or no?

Post by leruman »

I have one dilemma about hot to proceed with coding of my game. I made basic game using Halls tutorial for browser based RPG. On major change is that most of screen are loaded using AJAX to reduce load on server.

In next step i want to make code of game more consistent. Idea was to use some of PHP frameworks, and to transfer existing code to it.

Is it worth of hassle to do it? Pure PHP is working correctly now, and it is simply to use AJAX to load pages. I am concerned that going to PHP framework would complicate my life too much. I am not web programmer as per profession, so i would need to learn how to use framework .

Are there some more significant benefits form using framework for this type of games, than just better structured code in model, views and controllers. I am aware of general benefits of using framework, but browser games are a more specific case than regular pages, specially with heavy use of AJAX

Note: I put this message in coding section, if admins think that is more appropriate for another section, change as necessary.
tourmaline
Posts: 34
Joined: Thu Mar 20, 2014 9:43 pm

Re: Using PHP framework for PBBG - worth or no?

Post by tourmaline »

I've never found the benefits of a PHP framework very useful, even in a large application. This is just my opinion based on my own experience and workflow, and the fact that I've also never began a project from scratch with a framework; so take it with a grain of salt. I really don't use IDEs either, so my opinion is already weighted in the "no" direction.

the big benefit of a framework is keeping a team constrained to a standard layout and style.

To me PHP isn't that big of a deal. You're not dealing with source files and object files, you're not really linking and compiling like other languages. And if you need to change your organizational logic, it's not that big of a deal to do as long as it gets done around the time you realize it needs to get done. I've added new segments of functionality to a PHP application, and at some point in the process have moved large sections of code around to better facilitate the business logic - in which case a framework may not have been a benefit.

It sounds like you already have a good general idea of code organization, but it could also depend on what your code looks like now. Simply working doesn't necessarily translate into good code. Have you organized your code in logical manner? Can you quickly find what you need when you need to get to it? Do you ever intend on recruiting help, and would someone be lost once they jumped in?

If you've been coding full steam ahead and leaving behind a trail of tears, then maybe it could be the same amount of effort to reorganize by your own standard or with a framework.
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Using PHP framework for PBBG - worth or no?

Post by hallsofvallhalla »

I agree. Frameworks tend to be for apps using larger teams or a large app that needs to be uniform. Just code everything in your own standards and then you have your own framework. Adding one now will only put you further behind and make a lot of unneeded waste imo.
leruman
Posts: 29
Joined: Fri May 25, 2012 6:06 pm

Re: Using PHP framework for PBBG - worth or no?

Post by leruman »

Thanks for your opinion.

I had mostly similar reasoning, but wanted to hear opinion of someone with more experience.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Using PHP framework for PBBG - worth or no?

Post by Jackolantern »

I am on the opposite side of the spectrum. After working with Rails, Laravel, ASP.NET MVC and other high-end, well-designed web frameworks, I consider them a requirement in PHP for all but the most simple of projects (like a script or two). Once you get used to them, they can speed up productivity dramatically, and they make redesigns or maintenance so much easier. The "all-in-one-pot" style of having PHP, HTML, and SQL all mixed together just doesn't cut it for me anymore.

Also, if you are wanting to move into professional web development, it is a good idea to get familiar with them now since they are used in the vast majority of commercial PHP work these days.

And there is even a PBBG-oriented PHP framework designed by our own Curtis Delicata called Modular Gaming, which is based on the quite nice framework Kohana.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Using PHP framework for PBBG - worth or no?

Post by hallsofvallhalla »

Also, if you are wanting to move into professional web development, it is a good idea to get familiar with them now since they are used in the vast majority of commercial PHP work these days.
agreed!
tourmaline
Posts: 34
Joined: Thu Mar 20, 2014 9:43 pm

Re: Using PHP framework for PBBG - worth or no?

Post by tourmaline »

Jackolantern wrote:The "all-in-one-pot" style of having PHP, HTML, and SQL all mixed together just doesn't cut it for me anymore.
Just for the record, I'm certainly not advocating an "all in one pot approach", and I don't want my reply to come across that way. ;)
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Using PHP framework for PBBG - worth or no?

Post by Jackolantern »

tourmaline wrote:
Jackolantern wrote:The "all-in-one-pot" style of having PHP, HTML, and SQL all mixed together just doesn't cut it for me anymore.
Just for the record, I'm certainly not advocating an "all in one pot approach", and I don't want my reply to come across that way. ;)
Then you should check out some MVC frameworks. The separation is magnificent :)
The indelible lord of tl;dr
Lazer
Posts: 3
Joined: Wed Oct 15, 2014 9:02 pm

Re: Using PHP framework for PBBG - worth or no?

Post by Lazer »

I know this thread is pretty old, but I was going through this same dilemma at a similar time and decided to port from vanilla PHP to Laravel. My main question was - is it worth it? What I have in vanilla PHP right now is working and functional, is there really a good reason to recode the entire thing?

It was! The port took a few days, and there is still so much to learn to use MVC and Laravel in the best way possible, but it has helped me get a better structure for my large project. Plus some reassurance that I'm at least using a framework that cares about and implements a lot of best practices that I may have otherwise missed or have had to spend a bunch of time implementing/refactoring/having internal debates over before.
Post Reply

Return to “Coding”