WebGames+Questions

Started by
6 comments, last by llamaSong 17 years, 6 months ago
I've been at this site for around a year. I first started just looking at things, fooled around in C++. I've learned python and feel fairly good at it. I have made some really basic games in pygame. As well as a fairly large text based RPG in python. So I come to you people yet again, with some more questions. I want to hopefully, within in the next year start creating a browser based game, but something with out real time graphics. What languages tools should I learn to make a browser based game similar to http://evolution.neondragon.net/# Is python sufficient? I have heard of things such as php mySQL, what are these and how do they relate to browser games? I read that to create my own website(I allready know basic HTML), that I need a domain name, and a web server. How are these things connected? I have read that my ISP can provide space for a fee. Is my ISP the same company I use to connect to the internet(In this case Verizon, DSL.) Do I register my domain through them? Or through another company like hostmania.com? Thats about it for today. Thx all.
Advertisement
Your link is bad. I can't load that example you posted.

PhP is a server-side language that dynamically creates HTML. the simplest example is a website that says "Hello Frank" to the user Frank but "Hello Bob" to the user Bob. It's supported through the use of modules by most web server applications (the webserver is the application that actually sends you the page you are viewing). MySQL is a specific database application. A database in general is what runs the backend of a dynamic website (for instance it stores the information about Bob and Frank so that the proper user specific data can be displayed). PHP interacts very simply with databases so you can just querty the database, get the data and display it however you want.

Python, while a great language, doesn't easily plug into any webserver apps that I know of so it would likely be a bad choice.

PhP would be a great choice if you are doing a static image/text based RPG. i.e. it's either all text based or the game doesn't really animate (all moves are done by reloading the page).

If you want animations and craziness going on real-time you'll want to program it in something like Flash or Shockwave.

If you want a website that others can view then there are a multitude of options:
1) there are free hosting sites out there if you have very little data. But they won't support any language that you need to make your web game.
2) There are cheap hosting providers that will set you up with web space and PHP support.
3) you can buy your own domain name and point it to a specific webserver. a domain name is just a proxy for an IP address (www.google.com is really 66.102.7.104). You can either buy the domain seperately and point it at your webserver or the company from whom you're renting the webserver space will have a means to register the domain name for you.

-me
Macromedia Flash is a good tool to make web games.
www.dannylum.com/games_projects.html - My Game Projectswww.dannylum.com/D2DProject - My Open Source 2D Map Editor
I can answer the questions relating to web server, domain name, etc:

To say that you "need" a webserver is not so much the case as you need a machine that connected to the internet with a database server that you can access and the appropriate server-side scripting support. Personally, I found this easiest to do at home, but I have legacy hardware and I anticipated single-digit hit counts, possibly double-digit on the weekends when I was working on it. :P There are services available that provide this stuff for a fee, too.

Most ISPs offer web-space which is only good for HTML and small files, such as pictures, and do not support server-side scripting languages or provide access to databases, which are tools you will need. The ISPs choose not to do this because internet security is a big can of worms and they don't want the liability from inexperienced users making mistakes that are later exploited by professional crackers, or even 13 year old script kiddies with packages they downloaded off of IRC.

I should point out that by rolling your own webserver, you are most certainly going to have your machine intruded upon unless you research how to secure your webserver and get advice on how to provide the fewest vulnerabilities possible. Even then, the internet is lawless and you can probably expect a constant stream of intrusion attempts.

PHP is a server-side scripting language that is very popular for being free, fast enough, and sufficiently powerful for pretty much anything web-based. MySQL is a similarly free and popular database server. When combined with Apache, a free web server to run on your machine, you have a combination with hundreds upon hundreds of HOW-TOs written about installing, configuring, and doing whatever the heck you want. This is especially true if you run these on some form of Linux.

Regrettably, I do not know Python, so I can't say whether that language is well-suited to what you want... it could be, but I leave that someone better informed than I. I can tell you that PHP, MySQL, and Apache are probably capable of what you want, plus or minus any advanced client-side web trickery, which will have to be managed through client-side scripts like &#106avascript. The difference is that things like the text in these forums and the page layouts are managed through server-side scripts, while things like the popup menus on the link bar at the top of the page are client-side.

Once you've figured out your webserver (to buy space from someone else with the features you need or to roll your own), now you need to figure out your domain name.

In truth, you actually don't "need" a domain name, really - you can simply specify the IP address of your server (or properly configured router) and that will work across the internet if everything is setup correctly. Anyways.

A domain name is a name and a postfix (like gamedev.net) that you reserve and its reservation is stored by a centralized authority so that nobody else can snatch it from you. From that name you specify hostnames (like "www", as in www.gamedev.net) and point those to IP addresses with the help of a DNS server. I might as well take a moment to plug the group I get domain names and DNS services from - DirectNIC. It is also possible to roll your own DNS server, but that's something I never bothered to do because I can afford DirectNIC's trivial yearly fee of $5 USD for them to take care of that. I don't know if Verizon offers these services, I don't know of many ISPs that do.

The trick to pointing a DNS server at an IP address is making sure that your IP address doesn't change. On most cable internet services this isn't a problem unless there's a hiccup in your connection, but if you don't want to have to periodically check your IP address and make sure it hasn't changed, then make sure you ask your internet provider for a static IP address (this is usually something like $5-$10 USD more expensive than dynamic addresses... go figure). Also, whenever you change the IP address that a hostname is pointed to, it can take a couple of days before that change is propogated into the massive internet. The internet is huge, so patience is a virtue.

If you point your domain name or hostnames to a router (most likely the case), you'll need to configure your router to pass those along to the webserver itself - I won't be covering that as I'm already at "novel" length posting.

Whew.

Some good places to look at:
PHP Homepage
MySQL Homepage
Apache webserver
A brief HOW-TO on domain names

I hope that helps... you sound very new to web technologies, so there's going to be a lot to learn!
Thanks for all the help guys. The community of this place is awesome.

It seems like I need to look into PHP and MySQL, I'll do that.

Indigo, if I understand you correctly, I could register a domain, "Point" it to the IP of one of my computers and have that be the, server, provided I don't expect much traffic? Provided I protect it correctly?
I'll probabbly just go through another company or something anyways(For web hosting.)

Thanks for the info every one.
Is it possible to test PHP code with out having a website?
Quote:Is it possible to test PHP code with out having a website?


Sure. I'd recommend installing Apache and PHP on your Windows/Mac/*n?x machine, just don't make it available for the world to see (which should be the default behavior anyways). If you test your PHP on the same machine that's running Apache, you can just refer to the server as 127.0.0.1 in your preferred browser.

Quote:Indigo, if I understand you correctly, I could register a domain, "Point" it to the IP of one of my computers and have that be the, server, provided I don't expect much traffic?


That's what I did. The thing about traffic is that most ISPs offer packages that are focused on providing download speed (traffic going to your house) rather than upload spead (traffic going away from your house). Webservers naturally need more going out than going in, so if you expect a decent amount of traffic than your home's "broadband" probably isn't up to the task.

Quote:Provided I protect it correctly?


Configuring firewalls and the Apache webserver is not as painful as it may sound, but it does require some research. When it doubt, be paranoid, and only make available the minimum amount of stuff possible.

Apache does come with toys like automagically inserting the server software's name and version number at the bottom of certain generic pages... for the love of everything good, turn that off because script kiddies can Google for that stuff and immediately know what kinds of attacks your server would be vulnerable to.
Thx!

This topic is closed to new replies.

Advertisement