Page 1 of 2

PHP Game

Posted: Sat Oct 23, 2004 5:55 pm
by chensta
Hey guys, I am beginning Year 12 now and Im about to start my major project. I thought I might make a little turn based game in php.
Here are the details of the game.

The game will have a racing theme.

I will create a map with maybe 10 cities, each city have their own drag circuit, and normal circuit, a car dealer, petrol station and a mechanic to fix your car.

The user buys his car from the dealers.

He may travel around the cities for a certain amount of fuel.

When his in a city, he can goto a 'racers lobby' and create races, selecting tracks within the city. And how many racers, race type, maybe class of car - so a ferrari doesnt take on a MINI. And the prize money.

The driver may pay a fee to do training sessions at the tracks, which will improve driver knowledge, as well as other skills.

The results of a race will be calculated this way - each track will have attributes, say 30% power, 50% handling, 20% knowledge for a twisty track. The driver will have skill attributes, say 7 for power and 8 for turning, 7 for braking, this is then calculated into the car is driving. So he might use from 80-100% of the cars power, and 90-100% of the cars handling. Where a high rating driver might use from 99-100% of the cars potential. When the car stats has been randomised for the race, for example 89% for power, and 93% for handling, it is then put into the track according to its importance. so it turns out power will be only 26.7% when the track is 30% power.
Finally the driver knowledge comes in, the driver gains 1% knowledge for each race, and bonus 2% for each win. This will make some people choose 1 city and stick with it (like a hometown).

After the race is done, the winner gets the amount of cash set by the race host. That money can be used to buy better cars etc. And appropiate amount of fuel is deducted.

This is the basic idea of the game, dont know if i missed anything, if you have questions please ask.
The reason i choose to do this is because i am interested in cars, and webdesign, so i will probably never use VB or C++ again in my life.

What i would like is, how long would such game take to program? (i have about a year), and what is the difficulty level? If i just implement a skeleton of the game first, will it be easy to add the features on 1 at a time?
Thanks for reading, it will also be great if we could have a chat on MSN, PM me for my details :)

Thanks

William

Posted: Sat Oct 23, 2004 5:59 pm
by Deemo
The time period for making this really depends on how your structure this. for a big project like this, i would highly suggest using OOP. Also with OOP, features can be easily added.

Sounds like an interesting idea. keep us updated :D

Posted: Sat Oct 23, 2004 6:12 pm
by John Cartwright
In my experience I have seen a lot of kids your age attempt things like this only to lose interest in a little bit. Make sure you are dedicated and motivated enough to work for several months. Also you want to consider how popuplar your game might be, unless you are doing this for your own learning (which i see many better ways to learn than a game).

But the bottom line is make sure you are willing to read a lot of articles on OOP :) unless you want to seriously re-use code throughout your site because this will be NO small project indeed.

On another note, I would throw in some random variables, like rain or dry days, which will affect control, etc etc. and throw in random crashes or something. Relying on stats too much will in the end make your game too boring and repetitive.

Posted: Sat Oct 23, 2004 6:26 pm
by chensta
thanks for the quick reply guys, i am very dedicated and i am willing to stick with it and learn. The random variable idea is really good :) keep the ideas coming

Posted: Sat Oct 23, 2004 6:53 pm
by John Cartwright
I recommend you atleast spend a month planning the whole process and make sure you understand how you are planning on doing things.

Planning is just as important as implementation.

Posted: Sat Oct 23, 2004 7:00 pm
by m3mn0n
I concur.

Re: PHP Game

Posted: Sat Oct 23, 2004 7:35 pm
by Roja
chensta wrote: What i would like is, how long would such game take to program? (i have about a year), and what is the difficulty level? If i just implement a skeleton of the game first, will it be easy to add the features on 1 at a time?
Thanks for reading, it will also be great if we could have a chat on MSN, PM me for my details :)

Thanks

William
Hi!

As someone with several years in PHP game programming experience, I'll answer that the game will take "as long as you let it".

I started making "just a few improvements" to an opensource game, and two years later, I had my own fork of the game, which I then worked to merge back to the original.. talk about a LOT of work.

Many people will give you interesting suggestions: Use OOP, Start from scratch, and so on.

Some are accurate, some wont be - it entirely depends on your project. I have one game I code now that has almost no OOP code - yet its fairly maintainable (finally), fast, and extensible. However, I also have a new game that I invested in heavily, that is almost entirely OOP - its hard to make a quick fix in it, but it is very well designed.

Use whatever makes things easy for you. Programming a game is GREAT - it lets you have fun AND immerse yourself in code. When you get too bogged down in { design, research, OOP, perfection }, you step away from the fun, and into the complex.

Don't get me wrong, there are things any game will need that will require SOME level of complexity - authentication isnt idiotically simple, or there wouldnt be 200+ threads about it here, right? :)

Point is, you want to ENJOY the process. If you find that you are getting bogged down, work on a different section. Eventually, your subconscious will figure it out, and you will have the urge to attack it, or you'll realize after the fifth try that you need to learn more - and thats what these forums are for!

All in all, its complex. Between TKI (The Kabal Invasion), Wordog (WORld DOmination Game), and my upcoming game ("The Dragon Saga"), I've learned quite a bit about the whole php-game-design thing, and there are definitely advantages and disadvantages to every choice, save one.

Choosing to do it will almost definitely mean you CAN have fun. :)

I'm online fairly often, and more than happy to chat - I use all IM systems OTHER than MSN (Microsoft needs no encouragement), if you want to chat, feel free to PM me.

Posted: Sat Oct 23, 2004 8:03 pm
by kettle_drum
As the others have said plan, plan and then plan some more. If your in year 12 then im sure you will be covering the Systems Life Cycle and so know how to plan and do analisis of the problem. By following the cycle you should also find that you write your spec at the start and so dont go adding new features half way through - which can often mean you spend an extra few weeks on a project. So really stick to what you outline at the start and dont keep adding loads of other features.

I personally dont think the actual coding will be very hard as long as you have a basic grasp of php and sql. Each city will be run from the same script - getting its individual variables from the database. And then you do the same thing for everything else - shops etc. The only bit you may find hard will be the working out the winner of the races - but as long as you get the formula working its simple.

Good luck!

Posted: Sat Oct 23, 2004 8:35 pm
by chensta
thanks alot for the input guys! i will probably spend the rest of this year planning and as well as brushing up my php, and begin work early next year. I'll keep you guys updated, if I ever need anyhelp, i know where to go ;)

Posted: Sat Oct 23, 2004 9:28 pm
by Deemo
the biggest help in the beginning of major project is to have all the algorithms written out, and everything worked out in a nice structured outline or flowchart. those have always helped me out

Posted: Wed Oct 27, 2004 4:47 pm
by chensta
hey, i am planning to make a really cool interface, but it might take a bit of bandwidth, but that is not the problem, the problem is it might be slow for users. So i was wandering if theres a way to say download all the images and other media components to the users desktop, and load it from there?

Posted: Wed Oct 27, 2004 4:56 pm
by kettle_drum
Most browsers should cache the images/css after the first download so that should speed things up from that point onwards.

Posted: Wed Oct 27, 2004 9:55 pm
by John Cartwright
chensta wrote:hey, i am planning to make a really cool interface, but it might take a bit of bandwidth, but that is not the problem, the problem is it might be slow for users. So i was wandering if theres a way to say download all the images and other media components to the users desktop, and load it from there?
That wouldn't be smart, and very ineffecient. You can have a really cool interface without it being bandwidth heavy....

Posted: Wed Oct 27, 2004 10:45 pm
by Roja
chensta wrote:hey, i am planning to make a really cool interface, but it might take a bit of bandwidth, but that is not the problem, the problem is it might be slow for users. So i was wandering if theres a way to say download all the images and other media components to the users desktop, and load it from there?
Yes - they call them "Graphics packs".. but to be honest, few players do it, so you'll be limiting the number of players that will play.

A *large* number of people play from work, where they cant download, cant install plugins, and cant store their login - so make it as simple for them as possible.

Posted: Thu Oct 28, 2004 2:58 am
by phpScott
Just another thought that you could do is to allow the players to 'set up' there care to be more for fast tracks or for curvey courses.

Since it seems that it will be mostly a text based game, just keep the graphics small and simple. You want the user to enjoy the game and not get frustrated with the slow speed of the game.

phpscott