Sign in to follow this  

[Web Based]PHP, MySQL, Javascript, HTML5 which do I use?

This topic is 669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been coding for a while now and have a decent beginners grasp with C++. I took a course in high school and it stuck with me ever since (about 12 years now), but I've never developed anything significant and still consider myself a beginner.Just recently I've started learning PhP, MySQL and Javascript in order to start making my own web based game. Before I go through all this trouble I would like to know if there is anything I am missing, what languages I should be using and how to make everything come together. 

 

I am not asking how to code it, I will learn that on my own. I am more or less asking if I am on the right track or not. So here is the information about my game.

 

  • Web Based
  • MMORPG
  • Players will have a log-in system to access the game
  • I will be keeping track of each users information (name, email, character info, etc)
  • This game is mostly text based...there will be no "live action" or 3d/2d model animation. I will have pictures however.
  • If I had to say it was similar to any game I would say Reign of Blood...or, every Myspace game if anyone remembers those.
  • I would like the ability to drag/drop to equip gear.
  • There will be "server wide" events
  • PvP allowed
  • Automated offline battling (Combat will basically be done by pre-selected skills and stat comparison).
  • Online battling will be 2 players currently online in a turn based (each turn is timed) combat that select a skill to use and (again) stats will be compared to determine winner
  • Inventory system
  • Quest system

So my current plans to are use mainly PHP and MySQL. My idea is to set up mostly everything with PHP using OOP. HTML5, CSS and some Javascript for making the page look and act a little better. The question is, would this be the best way of doing it? Should I be using PHP to basically program the game with? Or would I have better luck using another language?

 

Share this post


Link to post
Share on other sites

I bet you know, that there's no golden rule - what you should chose is up to your interests, skills and plans for the game (should it be "finished"?) as well. First let me say, that your plans are very ambitious for a beginner... programming a game server alone is everything but trivial. There are also many architectures you could chose from. As I understood for now, you want to create a so called browser game, in the style of OGame, Travian etc, correct? This could be achieved with an event-driven server architecture - maybe stay focused on JavaScript and use a Node.js server. Advantage is, that you are very hip with this stack, nowadays :P PHP on the other hand is not really meant to power a game server...but for saving stats and small pieces of logic, it will work too. You have to keep in mind that if you want something "massive" on the server side, you have to chose an efficient platform and offload as much as possible to the client. That said, you could consider making the game a single page application, communicating with an event driven server.

Share this post


Link to post
Share on other sites

As I understood for now, you want to create a so called browser game, in the style of OGame, Travian etc, correct? This could be achieved with an event-driven server architecture - maybe stay focused on JavaScript and use a Node.js server. Advantage is, that you are very hip with this stack...

 

I agree on that. PHP is getting really old and I also prefer the "modern web" standards. Node.js on the server side offers alot of frameworks and modules which can help you build your application faster. It is also convenient to work on a one language stack instead of different languages. Using a javascript client side framework with a javascript server backend will get things done quicker.

 

Maybe take a look at:

Node.js with ExpressJS or Koa for the server side

passportJS for authentication in node.js

sequalize or bookshelfJS for Database access.

 

For the client side you have to take a look for yourself. Just google "javasript frontend framework".

I learned to use Jade for rendering my pages with node but there are alot of other frameworks around.

 

Also if you decide to create some 2D/3D scenes later on it is much easier to integrate them in your existing javascript code.

Edited by Olaf Van Schlacht

Share this post


Link to post
Share on other sites

I bet you know, that there's no golden rule - what you should chose is up to your interests, skills and plans for the game (should it be "finished"?) as well. First let me say, that your plans are very ambitious for a beginner... programming a game server alone is everything but trivial. There are also many architectures you could chose from. As I understood for now, you want to create a so called browser game, in the style of OGame, Travian etc, correct?

 

Yes, I am aware that technically it doesn't really matter which language I choose, so long as it works as intended. As far as plans go for it being completed....for now the main purpose I'm doing this is to learn the skills to accomplish it and keep those skills sharp. I do also realize that the plans are pretty ambitious but honestly, as a beginner you can only do so many "easy" things to expand your skill set. Doing this allows me to step far beyond my comfort zone and forces me to expand my knowledge (something that entices me very much). I love to learn and I love coding so I'm down for even learning languages I know nothing about. My question was more geared towards which language is more efficient. 

I realize that the question might not be answerable simply because you have almost no idea about how I'm planing on coding it....but any help is appreciated. From what I am picking up on is that I should be based more on Javascript? I have heard that can make the site run sluggish but having no prior experience programming an amount of javascript to feel that effect, I don't know if there is any truth to it.

And the game does resemble OGame very well but without the emphasis on all the time limits and "empire building". It will basically be along the lines of creating a character, doing combat and completing quests to make your character stronger, acquiring new skills and picking which ones to use at the best times, with other ways of making your character stronger (be it equipped items or 'buff' consumables). Players will also be handing over items to NPC and a running total will be kept which will eventually unlock new features and open up the game even farther. Clans/Guilds are also a desired feature a long with a chat service of sorts.

Edited by Monenfer

Share this post


Link to post
Share on other sites

Probably steer clear of PHP, simply because you don't need it here. Look at utilizing JS the most using NodeJS, SocketIO, HTML5 Canvas... You can look into Cocos2D-HTML5. Just a little note I would tone down the MMO part, maybe focus on a single player RPG first that is going to be quite the work load alone and stating you are a beginner really does point to that way first.

 

Also a side edit, make sure you understand JSON data types if you are working a lot with Javascript. You can weight the pros and cons of using MySQL, PostgreSQL or MongoDB to decide if this is what you need to implement if you do go the harder route of MMO or just for the sake of learning it.

Edited by wicked250

Share this post


Link to post
Share on other sites

This topic is 669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this