Author Topic: Big Help  (Read 1197 times)

Offline Aravinthan

  • Level 2
  • *
  • Posts: 5
  • Reputation: +0/-0
    • View Profile
Big Help
« on: March 10, 2009, 07:18:57 PM »
Hi guys,
1. I would like to know how can I update a value with php automatically. I am making a hockey browser based game. The users take control of a team and get players in their teams. I would like to know how can a player get their stats updated automatically, taking in account the player potentiel, using php , if its possible.

2. I would also like to know how to create a season. Every season has 82 games. After all the teams has played 82 games, the playoffs starts. After the playoffs ends, the season 2 starts.

3. I would also need help to create a code that creates a schedule for the teams, automatically after the season has created. Every teams playes 82 games. 41 games away and 41 games home.


Thanks for your help,
Ara

Offline Teckniel

  • Level 5
  • *
  • Posts: 18
  • Reputation: +0/-0
    • View Profile
Re: Big Help
« Reply #1 on: March 11, 2009, 03:11:45 AM »
Hello.

I don't want to sound rude, but i suggest you have a re-look on the basic's of php.
I can give you the code for it, But you would not learn anything :)

Regards Me

Ps: come with code of somthing you have tryed etc..

Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: Big Help
« Reply #2 on: March 11, 2009, 03:20:31 AM »
come with code of somthing you have tryed etc..

agreed, I am happy to offer a few words of advice, but i will not invest anything more than a minute or two on anything that someone hasnt had a good attempt at themselves.

also an example helps us identify exactly what your asking....for example...'how can i update a value with php automatically' could be as simple as

Code: [Select]
$newvalue = $oldvalue + $change;
or it could be a question all about the finner workings of cron jobs.

Offline pavansss91

  • Level 18
  • *
  • Posts: 185
  • Reputation: +1/-0
    • View Profile
Re: Big Help
« Reply #3 on: March 11, 2009, 04:18:28 AM »
hi aravinthan i am from india
i think i can help u
pm me :)
bbgFramework v0.1.3
Sun Database Class v0.3

Offline Aravinthan

  • Level 2
  • *
  • Posts: 5
  • Reputation: +0/-0
    • View Profile
Re: Big Help
« Reply #4 on: March 11, 2009, 07:02:46 AM »
@Scion and Teckniel
I already know the basics of PHP and MYSQL.
I already made 4-5 sites with php and mysql including my personal one: http://aravinthan.x10hosting.com
So dont think that I am one of the newbies that comes in and asks help. And I aint asking for the code, I just want little guides or tutorials...
 For 1. I know you can make something like this:
Get the current time. If time == 18:00(lets say)
then select the values from the table.
if postition == forward then
check his potentienl, if potentiel is A then give this much of points
SOmething like that right?
The season also I have my idea.

But for creating the schedule I am jsut lost.
@pavansss91
Thanks, I will pm you.

Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: Big Help
« Reply #5 on: March 11, 2009, 08:07:50 AM »
one issue i can see with running a season is how too deal with players that stop playing mid-season.

as for how to do seasons....id probably do it similar to how game rounds are run in round bassed games. so all players start a new season at the same time. the games are scheduled and when finished all players that are in the promotion zone go up to a higher league...those in the demotion zone go down and then all players in each league level are shuffled and re-grouped into new seasons for the next round...

youll want to have unlimited leagues and probably some sort of unlimited ladder of league levels as well for the open game.

you may like to think about private leagues as well for players to set up themselves, so they can invite their friends to compete directly against.

to keep new players interested while waiting for the next season to start you may look at a tutorial system and allow them to have firendly games against other players. or a series of qualifiers or something...

but this is just my own ideas....

when brainstorming i find it helps to not let myself be constrained by any restirctions, just let your imagination go wild...write everything down and only then stop to look at what is do-realistic or how you could do something.....


Offline Greyth

  • Level 6
  • *
  • Posts: 23
  • Reputation: +0/-0
    • View Profile
Re: Big Help
« Reply #6 on: March 13, 2009, 12:41:09 AM »
On #1 & #2 I don't think I understand what you are wanting to do well enough to help..

On #3, I think I see what you are asking...

It shouldn't be too hard... start by splitting the players into two groups.

Then create your 41 random games for each player against a player in the other group. So players in group #1 will always be facing players in group #2.

Always set the location to "home" for the player in the group you are processing... so while players in group #1 are getting their "home" games, it is giving "away" games to group #2 at the same time.

When it finishes each player should have 82 games, 41 home and 41 away.

I would just save them in a schedule table like:

gameId, homeTeam, awayTeam, round#

... and make homeTeam and awayTeam indexes so the database lookups will be quick.

Hope that helps.

Offline raestlyn

  • Level 29
  • **
  • Posts: 463
  • Reputation: +9/-5
    • View Profile
Re: Big Help
« Reply #7 on: March 13, 2009, 08:47:14 AM »

3. I would also need help to create a code that creates a schedule for the teams, automatically after the season has created. Every teams playes 82 games. 41 games away and 41 games home.

there you go. Google is your friend, you know ;)


I can send you pics of my cocks if you want reference.


Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: Big Help
« Reply #8 on: March 13, 2009, 09:16:38 AM »
yep the actual process of generating a playing schedule is a solved problem. Its allways worthwhile to stop and ask yourself if someone might not have already solved your problem before....

if they have....then theres a good chance that google knows about it......google knows everything after all ;)

Offline Aravinthan

  • Level 2
  • *
  • Posts: 5
  • Reputation: +0/-0
    • View Profile
Re: Big Help
« Reply #9 on: March 14, 2009, 01:46:40 PM »
Thanks guys
but when I run it, it doesnt execute the code,
it shows the coding:
« Last Edit: March 15, 2009, 08:59:32 AM by Aravinthan »

Offline Greyth

  • Level 6
  • *
  • Posts: 23
  • Reputation: +0/-0
    • View Profile
Re: Big Help
« Reply #10 on: March 14, 2009, 09:30:30 PM »
Hmmm... it looks like you are  missing opening and closing php tags <?php and ?>

Also, note that the code you have on the page is just an object. In order for it to actually do anything, you will have to actually instantiate it and make use of the methods within it.

Good luck.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal