Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411485 Posts in 69371 Topics- by 58427 Members - Latest Member: shelton786

April 24, 2024, 03:50:03 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Advice on solution for community-goal based game.
Pages: [1]
Print
Author Topic: Advice on solution for community-goal based game.  (Read 539 times)
oByhring
Level 0
**


View Profile WWW
« on: September 11, 2014, 11:40:17 PM »

Hi!

I'm making a simple 2D-space shooter where everybody who is playing the game is cooperating on defeating an enemy population. For every enemy ship you shoot down, this population should decrease by 1, and it should increase according to some specified growth rate (1.01 per month/year/week/whatever).

What I need is to be able to report kills made in-game to a central system, and get the number of remaining individuals in the population to each device playing the game.

I plan on uploading the "kill count" in bursts to lessen the load on what ever server is getting these reports, and will use some prediction of population growth on each device so I don't have to poll the server too often to get the remaining population count.

If the problem is unclear, please let me know so I can go into more detail Smiley


I have access to a personal domain (but no possibility to run timed scripts / server side applications on this webserver), and a database. I know enough PhP to interact with the database, and can do simple arithmetics in PhP. Any good ideas to how I can solve this problem?

My current plan looks like this:

The devices report kill count once per day to a PhP script, which stores this in a database, and updates a "population-file" whenever this happens.
The devices can get the population count frim a PhP script which reads this file.
I have no idea how to fix population growth.

Any feedback is appreciated!
Logged

Game developer/programmer.
www.oyvindbyhring.net
JamesK
Level 0
**



View Profile WWW
« Reply #1 on: September 12, 2014, 10:08:39 AM »

You could possibly do a check to determine when the population was last grown when a user asks for the current population count.  If it has been too long, then calculate the new population based on how much time has passed.

The check would run every time the user queries for the current population, but if you are just checking against the current time versus some last update time, that shouldn't be too expensive.
Logged
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #2 on: September 12, 2014, 11:15:20 AM »

How much do you care about security? With any system like this, players will inevitably try to exploit it - if it's possible to send a simple "I killed X enemies today" message to the server, you can be certain that you'll get a lot of fake "I killed 342879342 enemies today" messages. A layer of basic encryption would keep out the most casual hackers, and that might be the best you can do with the server resources you have now...

As for predicting population growth, is there a reason the client and server can't share the same growth logic? You'll never get perfect synchronicity without talking to the server, but if the client's prediction grows at the same rate as the server's logic, it ought to be close enough.

Sending kill counts once per day seems problematic. You can't send it after the last play session in a day, since you don't know which session that will be. If you send it during the first play session of the day, that player's kills will be deferred, and the server's population will be somewhat inflated. Sending it after each play session ends seems like the way to go.

Is this game for desktop, console, mobile, web, some combination...?
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic