FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


In my game, storing scouting reports.





polly-gone
Okay, so in my game, which is browser based, you will be able to station soldiers any where you want in the world. An optimal place would be on a bridge between two islands. Now say someone sent a team of Scouts to check out an area across the bridge. They get to the bridge and they turn around and they don't come back with a scout report of the intended destination, but of the bridge becuase they could not get past.

Now say that same person sends a full-scale attack to the intended destination of the scouts. I want a JavaScript pop-up to come up saying "Are you sure you want to take that route? The bridge is covered in enemies!" The person will then be able to cancel the attack so that is doesn't get killed on the bridge.

What I want to know is how do I store who has seen what enemy camp?

This will be sort of like the system for unread posts on a forum.

If someone's scouts have seen an enemy camp, that person will get a warning that they are going to go past it, but if someone's scouts DIDN'T see the enemy camp, the person will receive no danger warning.

How would I implement a system like this?

-Nick Smile Smile Smile
polly-gone
Okay.... Here is an easier way to explain it. It is sort of like a read/unread system on a forum. What is the best way to store if someone has "read/not read" the location of an enemy?

Thanks,

-Nick Smile Smile Smile
rvec
I can't think of an easy way to do that. All the things I can think of would require a lot of tables or a lot of records per user (one per seen place).

I think the best would be one record per scout visit. You can only know the bridge had enemies on it when the scout was there, so it would be best to only know how it was at that time.

so one record per scout visit:
visit_id - time - place_id - occupied
visit_id = an id for each visit
time = time of the visit
place_id = the id of the place
occupied = false if it was empty, and player_id (or true if you don't want to show which player) if it wasn't
polly-gone
How do message boards, etc do it?
rvec
you're too fast Razz

But the above thing sound like the best way to me.

phpBB just takes the time you logged out for the last time and the rest is in the session I think.
polly-gone
oh.... Okay... so I guess I would have to have some sort of "Seen" Table with a user id and an enemy position id?

Well, every time a scout gets back or an attack ends, the player gets an attack report. Attack reports are like PMs and you will be able to have up to 500 of them. Would it work if it checked the players scouting reports?

-Nick Smile Smile Smile
Related topics
Favourite game? (OFFICIAL THREAD)
Countering Computer Game Addiction: Step Away from the Scree
Favourite Staratagy Game.
Java Game
Cricekt update on Sachin
witch game is better
boiling point - do you really play with that scrappy game?
Not humor, but a play-by-forum game.
Web Based Game
RoberT HorrY fLyin.. ..::photos::.. 5th game at finaL series
Game Server For Frihost?_? Lol..
So I am making this game.....
Storing Lists
Canada bans FOX-style "false or misleading news"
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.