Jump to content

Advice for my online Soccer management game.


Farflame
 Share

Recommended Posts

I run a Soccer management game, which is currently run by email. The player receives a text file, loads it into a client which parses the file, updates it and sends it back to me.

 

I need to rewrite the game since the game itself is over 20 years old and the email method is time-consuming at my end.

 

Here's my plan, I'm not sure if this is correct or if there are better ways, so please offer any advice.

 

I'll put the game online, with a database and it will be processed using PHP scripts (I don't like PHP, I'm much happier in BASIC, but I'll get used to it). The user will log into a web-based client, communicate through middleware (PHP scripts), which will contact the database and send the info back to the client. I think that part is correct?

 

A couple of problems. For the client itself, I don't know which language to use. I'm happiest in BASIC (I'm not actually a very good programmer, though I have completed quite a few games). I'm tempted to use Construct 2 or some other game-maker, to simplify the creation of screens in the script (it's a management game, so it's closer to a spreadsheet than a game, but it does still need to look gamey - i.e like the CM games). But game-makers always seem a bit weak when it comes to listboxes, buttons etc and I'm finding it a bit clumsy. The way it would work would be, when the client logs on, the server sends back the whole team which are stored in C2 as objects, and then every update would just be a call to a PHP script on the server (that part I can handle easily enough).

 

My other issue is the processing of the game itself. Since it's turn-based (a turn being a week in the game), when it's processed, everything needs to be done in one go. So all the matches, training, transfers etc. This is quite a big job (around 30,000 lines long in my existing game) and I'd prefer to do it in BASIC, but that will need an extra step, e.g a tool at my end to download the database, process the turn, then upload it again. I assume the sensible way would just be to process the entire thing in PHP (something I've started but I'm finding very difficult).

 

Any tips or advice?

Link to comment
Share on other sites

PHP is perfect for this, all your logic is pretty straight forward and honestly seems pretty simple. The tool at the end could just be an admin interface on the site, which you would login to do all your admin tasks. I wouldn't do this in BASIC since creating a website would be so much simpler, specifically with access.

Link to comment
Share on other sites

So everything in PHP? The logic part in PHP does seem the right way to go. How about the clients? What's the best way to get the information out to the players? Have PHP create / send the whole webpage script back to the user?

 

I've done a fair bit of experimenting, but not actually completed a webpage so I'm not 100% sure what's easiest / best. My client webpage will need to be able to gather the information and make changes back to the server. Can I just do this with PHP and HTML?

Link to comment
Share on other sites

I run a Soccer management game, which is currently run by email. The player receives a text file, loads it into a client which parses the file, updates it and sends it back to me.

 

I need to rewrite the game since the game itself is over 20 years old and the email method is time-consuming at my end.

 

Here's my plan, I'm not sure if this is correct or if there are better ways, so please offer any advice.

 

I'll put the game online, with a database and it will be processed using PHP scripts (I don't like PHP, I'm much happier in BASIC, but I'll get used to it). The user will log into a web-based client, communicate through middleware (PHP scripts), which will contact the database and send the info back to the client. I think that part is correct?

 

A couple of problems. For the client itself, I don't know which language to use. I'm happiest in BASIC (I'm not actually a very good programmer, though I have completed quite a few games). I'm tempted to use Construct 2 or some other game-maker, to simplify the creation of screens in the script (it's a management game, so it's closer to a spreadsheet than a game, but it does still need to look gamey - i.e like the CM games). But game-makers always seem a bit weak when it comes to listboxes, buttons etc and I'm finding it a bit clumsy. The way it would work would be, when the client logs on, the server sends back the whole team which are stored in C2 as objects, and then every update would just be a call to a PHP script on the server (that part I can handle easily enough).

 

My other issue is the processing of the game itself. Since it's turn-based (a turn being a week in the game), when it's processed, everything needs to be done in one go. So all the matches, training, transfers etc. This is quite a big job (around 30,000 lines long in my existing game) and I'd prefer to do it in BASIC, but that will need an extra step, e.g a tool at my end to download the database, process the turn, then upload it again. I assume the sensible way would just be to process the entire thing in PHP (something I've started but I'm finding very difficult).

 

Any tips or advice?

 

if you trying to save time, the best bet would be to do some trickery stuff such as:

 

Option A)

Have a cron job that will execute a PHP file which will read your email's and process all the text files. then send them back?

http://php.net/i_map

 

 

Option B

An alternate is depending on what processes your files, edit that code to accept txt files threw a socket connection then:

 

Have a cron job that will execute a PHP file which will read your email's, send the text files to your program (The thing that processes your txt files) and then send it back to your PHP file and email it back to the receiver

http://php.net/sockets.

 

 

I would go with Option B instead if your capable of it instead of re-writing 30,000 lines of code. It already works, and it sounded like you just wanted to speed some things up =}

Link to comment
Share on other sites

Thanks, though I think a rewrite would be a good idea for so many reasons and I'm quite happy to do it. There's no rush so I could just plod along at my own pace. I'm still not sure quite how I download the info from the server to the client, then have the client respond to checkboxes etc that are relevant to the returned information. E.G If a client downloads 50 players, they're all displayed with checkboxes for selection, how do I know which player's checkbox has been selected? I'm sure this is basic stuff, I'm going through more PHP tutorials but I suspect that I need to look into AJAX or JS or something next.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...