Assitance? A point in the right direction?
#1
Posted 10 November 2011 - 09:14 PM
Im at a bit of a lose end and looking for some help
I currently studying web design languages (HTML, CSS, MySQL and Javascript) in order to develop an online game. The simulation i am looking at is a football manager game, in which i will have 1 league structure. The league structure will contain 64 teams, spread over 8 divisions (8 teams per division). In each of the 64 teams i will need a minimum of 16 players with no maximum size required.
Each season, all teams will play each other 2 times (home and away) meaning there will be 14 games per season. The season will have 50 game days (which will split into 25 real days). Each day will start at 00:30GMT and 12:30GMT (example below)
5th October 2011 - 00:30 - Gameday 1 - Fixture 1
5th October 2011 - 12:30 - Gameday 2
6th October 2011 - 00:30 - Gameday 3 - Fixture 2
6th October 2011 - 12:30 - Gameday 4
7th October 2011 - 00:30 - Gameday 5 - Fixture 3
....and so on and so forth!
- - - - -
Question 1) What i need to know, is how will i get a server to update itself to change game days every 12 hours?
- - - - -
Every player will have a basic stat collection of 4 stats, GK, DEF, MID and ATT. The higher the stat value in a particular area, the better the player. the maximum stat value a player can have is 30, the lowest being 1
As an example, ill make up a player profile below:
R Green - Midfielder - 24
GK: 3
DEF: 8
MID: 19
ATT: 5
APPEARANCES:
GOALS:
ASSISTS:
YELLOW CARDS:
RED CARDS:
AVERAGE RATING:
- - - - -
Question 2) Every time a player plays a match, ill need these stats to update automatically. How would this be possible?
Question 3) My match engine will randomly book (yellow card) or send players off (red card) - how would i get this to work?
- - - - -
The tactic selection will be pretty basic, you can choose between 4 formations and 4 styles of play:
4-4-2
4-5-1
4-3-3
5-4-1
Contain - Soak up all oppositions attacks by defending as a team (this will require almost all players to have good DEF skills). Players will play freely but will not overload in attack
Counter Attack - Players will soak up attacks but quickly break to try and score on the counter (this will require a good DEF, MID and ATT stats)
Expressive - Players will play freely and will try fancy passes/skills (this will require a high MID stat)
Overload - Players will go all out to attack (will require all players on the pitch to have high skills in MID and ATT stats)
- - - - -
Question 4) How could i make it that ATT's that play against better DEF's get better match ratings and vice-versa?
- - - - -
The league structures will be as follows:
L1 -
1 Champion
2 Relegation
L2 -
2 Promotion
2 Relegation
L3 -
2 Promotion
2 Relegation
L4 -
2 Promotion
2 Relegation
L5 -
2 Promotion
2 Relegation
L6 -
2 Promotion
2 Relegation
L7 -
2 Promotion
2 Relegation
L8 -
2 Promotion
2 Relegation
Question 5) Once a season ends (after 26 real days), how will i get all leagues to reset to 0 games ready for the new season?
Question 6) How easy will it be to create a 'history' table for each league season showing league winners/related teams from previous season?
___________________________________
There is much more to go into this, however i feel i've asked enough questions for the main part above. I'm hoping there's someone out there that will be able to point me in the right direction.
The game will be pretty basic initially but something i will build over a period of time, at which point ill develop an internal forum, more leagues etc etc
For the most part above, i believe i will need HTML, CSS and MySQL - but would i need anything else?
Please post ANYTHING you feel may be a help to me
Thanks in advance
TLM Solution
#2
Posted 11 November 2011 - 07:31 AM
Quote
Cron Jobs http://en.wikipedia.org/wiki/Cron
Quote
you need the php files to do the updating and then use CRON jobs again to "play" the matches
Quote
use rand() here is a VERY SIMPLE example:
if(rand(0, 20) == 1){
// gives a 1 in 20 chance of giving card
if(rand(0, 3) == 1){
// gives a 1 in 3 chance of giving a red card
echo 'give a red card';
}
else{
echo 'give a yellow card';
}
}
}
Quote
this depends entirely on how you plan on coding you "match" engine, you could use rand() again, example:
<?php
// $formationPoints = array['FormationType']['points for attack/defence']
$formationPoints = array('ATT'=>array('attack'=>20,'defence'=>10),'DEF'=>array('attack'=>10,'defence'=>20));
// assume you have a variables for $attackingTeamFormation, $defendingTeamFormation, $defendingTeamDefenceScore, $attackingTeamAttackScore
// team 1 takes it's shots
// team 1 is using an attacking formation and has an Attack Score of 30
$attackingTeamFormation = 'ATT';
$attackingTeamAttackScore = 30;
// calculate attacking team total score
$attackingTeamTotalScore = $formationPoints[$attackingTeamFormation]['attack'] + $attackingTeamAttackScore;
// team 2 has a defence score of 20
// team 2 has a formation of defence
$defendingTeamFormation = 'DEF';
$defendingTeamDefenceScore = 20;
$defendingTeamTotalScore = $formationPoints[$attackingTeamFormation]['defence'] + $defendingTeamDefenceScore;
// so we currently have
// attacking team = 50 points
// defending team = 40 points
// initialize goals as zero
$goals = 0;
//lets allow an attacking team as many shots as they have points, in this case 50 shots
for($shots = 0;$shots < $attackingTeamTotalScore; $shots++){
// the chances of scoring a goal should decrease with the defencive capibilities of the defending team
if(1 == rand(0, $defendingTeamDefenceScore)){
// gives a 1 in 40 chance of scoring a goal on each shot
$goals++;
}
}
echo $goals;
?>
Quote
This is going to be tricky, I would personally have a "reset season" button, or else set the php file that "plays" matches to check if all games have been played, if they have then reset the season
Quote
very easy, it is just another table with the totals in it.
Hope this helps even just a little
#3
Posted 14 November 2011 - 03:17 PM
Thank you SOOOO much for the help you've listed above, it will be invaluable and i may even have to come back to you on a few things at a later date. What i would like to ask you right now is:
What languages do you think i need to know and to what standard?
An example:
HTML - Basic
PHP - Advanced
...and so on?
- - - - - - - - - -
Also, what would you suggest i use for my match engine?
Don't get me wrong, this 'game' is in very early development and i appreciate this question may sound bizarre but i'm curious as to what type of web hosting and server ide need for this kind of project?
- - - - - - - - - -
One final thing, what would you recommend is a good programme for creating logo's?
This post has been edited by tlmsolutions: 14 November 2011 - 03:23 PM
#4
Posted 14 November 2011 - 07:39 PM
tlmsolutions, on 14 November 2011 - 03:17 PM, said:
Thank you SOOOO much for the help you've listed above, it will be invaluable and i may even have to come back to you on a few things at a later date. What i would like to ask you right now is:
What languages do you think i need to know and to what standard?
An example:
HTML - Basic
PHP - Advanced
...and so on?
- - - - - - - - - -
Also, what would you suggest i use for my match engine?
Don't get me wrong, this 'game' is in very early development and i appreciate this question may sound bizarre but i'm curious as to what type of web hosting and server ide need for this kind of project?
- - - - - - - - - -
One final thing, what would you recommend is a good programme for creating logo's?
You'd need knowledge of the following:
HTML
CSS
Javascript (Not completely necessary)
SQL (that is if you choose to use SQL)
PHP - (You'd need intermediate knowledge here for what you've described)
Also, what would you suggest i use for my match engine? - Codes?
i'm curious as to what type of web hosting and server ide need for this kind of project? - You could probably pull it off with a normal shared hosting plan that supports PHP. Depends on the amount of resources your project will utilize.
One final thing, what would you recommend is a good programme for creating logo's? - Photoshop or GIMP. Google and take your pick.
#5
Posted 15 November 2011 - 09:07 AM
for the engine I would just recomend that you should do lots of preparation before doing any code, start by putting pen to paper, write down the concepts, draw flow diagrams it becomes much easier to come up with the logic when you know what your goals (pardon the pun) are.
example of brainstorming:
start season, should players carry over there ratings?
start season, reset tables but save stats in a history table.
start season, generate fixtures table
run cron job every hour to "play matches"
in match determine which players are on the field
in match calculate total team skills based on players ratings
in match each team has a chance to attack and defend
in match each player has a chance at a card perhaps based on disapline rating
after match, players ratings should be affected by the result
after match log should be updated
etc etc etc
just put all your thoughts down, once you have everything then you can start with database design, this is in my opinion, the single most important part of your application, keep referential integrity and apply your indexes correctly and your app will be lightning quick.
as for the logo etc, I think that you should ask someone to help you design and maybe once you have ideas for the flow, maybe get someone to help with the application design too. If you really want to do the designs, inkscape and GIMP are great free tools for this.
as for the technologies involved,
(x)HTML
CSS
JQUERY (javascript for lazy people)
PHP ( study OOP for php, you will use it in this project alot )
- just imagine a class called player with functions like :
- shoot
- fowl
- defend
- etc.
mySQL (database engine)
SQL (for Queries)
make a point of making your project easy to customize, have a globals file with all your "main" information, that makes it easy to change later.
in my experience a using a variable for $domain make the program easier to move around, use it from the start and call it whenever you place an image, a javascript file, a css file, makes life a ton easier later.
for web hosting a shared host with php and mysql support, if you require log ins then SSL is always a nice addon
hope this helps, keep us informed of your progress
#6
Posted 15 November 2011 - 09:35 AM
My intention is/was to learn the following languages: -
- HTML - Know this
- CSS - Know this
- Javascript
- JQuery
- SQL/MySQL <- whats the difference (sorry)
- PHP
- ASP
- AJAX
Would any of the above be un-necessary?
- - - - - - -
Samus - "Also, what would you suggest i use for my match engine? - Codes?"
That's something i already knew....but codes its a bit of a bland response. I'm guessing most of the coding would be PHP....or would it all be PHP?
Geeks - I know that CRON jobs wll be very important in this particular project, ill need the game to update itself various times throughout the day (matches, training, transfer clock countdown etc). The brainstorming is a good idea but before i do this i need to get my head in some books and get the languages learned. It's quite important im pointed in the right direction, so from my bullet list above, would you advise me to NOT learn any certain languages
Thank you all so much for the advise given so far, and of course, i'll be keeping you all updated with my progress
TLMSOLUTIONS
#7
Posted 15 November 2011 - 12:29 PM
I will have 3 regions, each of which will have two league structures
EG:
British League - League Structure 1
British League - League Structure 2
Spanish and Portuguese League - League Structure 1
Spanish and Portuguese League - League Structure 2
Asian League - League Structure 1
Asian League - League Structure 2
Each league will contain 8 divisions with each division containing 8 teams (64 teams per league structure)
64 x 6 = 384 teams per 'world'
Each team will contain a minimum of 16 players and a maximum of 40 players (16x384 = 6144 (minimum) 40x384 = 15360 (maximum).
- - - - -
Side Question - a player will only have a career of between 15-20 seasons, at which point they will retire. When they retire ide want the database to automatically replace the retired player with another, younger player. How would this work?
All players will have id's. So if player A (p_id=12345) reaches the age of 45 and wants to retire, i'de want that player to be replaced by player B (p_id=22115) - will this require manual work?
Thanks in advance
#8
Posted 15 November 2011 - 12:39 PM
- HTML - Know this
- CSS - Know this
- JQuery = Javascript (Jquery is a Javascript framework)
- SQL/MySQL <- whats the difference (sorry) - SQL is Structured Query Language it is the language used to query and manipulate your database, mySQL is a type of database
- PHP - server side coding (your backend essentially)
- ASP - server side coding (your backend essentially) alternative to PHP
- AJAX - is more of a concept that a language, it is (in this case) javascript combined with PHP
#9
Posted 16 November 2011 - 08:39 AM
tlmsolutions, on 15 November 2011 - 09:35 AM, said:
That's something i already knew....but codes its a bit of a bland response. I'm guessing most of the coding would be PHP....or would it all be PHP?
- It would mostly be PHP and SQL
- HTML, CSS and jQuery(javascript) will be for your user interface
Geeks - I know that CRON jobs wll be very important in this particular project, ill need the game to update itself various times throughout the day (matches, training, transfer clock countdown etc). The brainstorming is a good idea but before i do this i need to get my head in some books and get the languages learned. It's quite important im pointed in the right direction, so from my bullet list above, would you advise me to NOT learn any certain languages
- use your cron jobs to run PHP files, so the PHP is still the heart of your app
- None of us (well at least not me) know all PHP, the MOST important thing about programming (in any language) is to know what you are trying to achieve (this is why project planners get paid more than coders) the code is secondary, know your plan first then learn the code to achieve the plan.
- as far as advice on what languages etc. it is all about your intentions, learn concepts, code is easy to learn. learn object orientated programming, there are some people that say procedural is better, but most people you work with/for will want OOP
you are going about this the right way and don't give up, feel free to PM me anytime
#11
Posted 16 November 2011 - 03:25 PM
tlmsolutions, on 15 November 2011 - 12:29 PM, said:
What about the above?
#12
Posted 17 November 2011 - 02:27 PM
it is up to managers to manually replace him, else the "manager" side of the game kinda gets lost.
#13
Posted 17 November 2011 - 02:39 PM
I'll do that, but if a team only has 16 players, and 1 player wants to retire, i want to make it so that the team will find a 'local ameteur' to replace the player - otherwise the squad will fall below the 16 required players
Does that make sense?
Is it viable?
Thanks
#14
Posted 18 November 2011 - 07:44 AM
make it a general thing, before each match check that both teams have 16 players, if not assign a random player who is not in there team.
players in team each have an id so lets say
// array of team's player's IDs $teamOneIDs = array(1454,1232,1111,1456,345,567,876,987,143,654,7643,1234,4646,6542,414); // note only 15 players $teamTwoIDs = array(11454,11232,11111,14156,1345,1567,1876,1987,1143,1654,17643,11234,14646,16542,1414); // note only 15 players
a side note, consider that team 1 and team 2 can't have the same players (I would think) or would certain players be available to certain teams ?
now we assign a random player to team 1
if(count($teamOneIDs) < 16){
// create the WHERE clause from the array
$where = 'WHERE ';
foreach($teamOneIDs as $pID){
$where .= ($where != 'WHERE ' ? 'AND ': '').'`id` != '.$pID.' ';
}
foreach($teamTwoIDs as $pID){
$where .= ($where != 'WHERE ' ? 'AND ': '').'`id` != '.$pID.' ';
}
// get all players from database that are not assigned to either team as an array
// the SQL would be something like :
$sql = 'SELECT `id` from `PLAYERS` '.$where.' LIMIT 1';
// execute the SQL using whatever method you perfer, I use PDO, the where would be slightly different
// this returns a random id now we assign that id to team 1
$teamOneIDs[] = $returnedID;
}
// now repeat for team two
again it goes back to my earlier sentiment, figure out the logic then the code is easy
#15
Posted 20 November 2011 - 07:43 PM
#16
Posted 24 November 2011 - 09:01 PM
Hope your wel, keep you updated with my progress!
PS. Downloaded GIMP - pretty difficult to use, any other suggestions for image/logo creation?
#17
Posted 25 November 2011 - 04:44 AM
tlmsolutions, on 24 November 2011 - 09:01 PM, said:
Hope your wel, keep you updated with my progress!
PS. Downloaded GIMP - pretty difficult to use, any other suggestions for image/logo creation?
You can try Photoshop.
I prefer GIMP anyway, it's similiar to Photoshop, just without all the extra shortcuts. Plus it doesn't have £1000 price tag on it.
#18
Posted 25 November 2011 - 08:23 PM
I'm pretty lucky in that ANY programme I want, I can have
Do you have any example work you've achieved on GIMP?
#20
Posted 08 December 2011 - 03:21 PM
How you lot doing? Geeks, ill try inkscape later on, or maybe tomorrow when i get a day off work
Ive put this development learning on hold until after Christmas when i intend to 'smash it'. I have recently started a new job so its all about learning that for the moment, and then we have the Christmas and New Year parties to contend with lol
#21
Posted 09 December 2011 - 12:32 AM
tlmsolutions, on 25 November 2011 - 08:23 PM, said:
I'm pretty lucky in that ANY programme I want, I can have
Do you have any example work you've achieved on GIMP?
http://lyricalz.com/images/sigs/
Those are a few i've done with GIMP.
#22
Posted 09 December 2011 - 06:18 AM
tlmsolutions, on 08 December 2011 - 03:21 PM, said:
How you lot doing? Geeks, ill try inkscape later on, or maybe tomorrow when i get a day off work
Ive put this development learning on hold until after Christmas when i intend to 'smash it'. I have recently started a new job so its all about learning that for the moment, and then we have the Christmas and New Year parties to contend with lol
All good this side, sunny and hot
Inkscape is a vector program, open source and free. it is not perfect but does the job.
personally I use Corel Graphics suite X5 (been using it since version 3)
also for layout etc. try Komposer it is pretty good.
and for coding try PSPad, highlighted sintax etc.
and when developing, use firefox until you are happy then test Internet Explorer.
#23
Posted 11 December 2011 - 09:09 PM
#24
Posted 11 December 2011 - 09:10 PM
Geeks, on 09 December 2011 - 06:18 AM, said:
Inkscape is a vector program, open source and free. it is not perfect but does the job.
personally I use Corel Graphics suite X5 (been using it since version 3)
also for layout etc. try Komposer it is pretty good.
and for coding try PSPad, highlighted sintax etc.
and when developing, use firefox until you are happy then test Internet Explorer.
All going in buddy - cheers
#25
Posted 04 January 2012 - 04:59 PM
I'm on a mission now - here we go......i intend to hit the ground running.
I know what my game is going to be called, i have an idea of how it will look....will upload screen shots soon
- ← Web filter search.
- Server Side (PHP, Databases, ASP.NET, etc)
- How to automatically append text to a form field? →
Help














