Page 1 of 1

oh noes! teh codez!

Posted: August 4th, 2005, 15:20
by Joose
Ok, those of you with good memories may remember the "Haxxor!" thing i was working on. Well, Ive been beavering away silently, and its...er...changed almost beyond recognition. Ahem.

The original idea of "an MMO played through a web browser" is still very much there. However, its no longer a hacking game. Basically this is due to:

a)it was turning into "Uplink: Online" at a rapid pace, and I wanted to do something a little more original

b)I had hit a slight problem, in that although i could easily model one person hacking into a system, two people hacking the same system made everything suddenly very, very complicated. which ruled out PvP entirelly. Which was shit.

So now the grand plan is....not very original either, frankly. Well, its a fairly original idea made of shitloads of unoriginal ideas. Basically, its going to be Civ in space with real people. ish.

But rather than harking on about game dynamics that may never happen, on to the point of this post:

Ive got a slight coding problem. Ive thought of a solution, but im sure theres a better way that i just havent thought of. The problem is this:

The whole game is powered by php/mySQL. So events in the game can only be resolved when someone goes on to a page, or reloads it, and the php is re-run. This is not a problem for most things, since I can kind of "fake" it; for instance, if the event is a ship travelling from a to b, then when it leaves a, a note is made of when it will reach b. The next time the player logs on after the ship reaches b, it will update and everything will be happy.

the problem arises, again, when two or more people are involved.

For instance, say i sent my battleship to blow up your space station. It will arrive and fight in three hours. I log off, and log on again in 4 hours, to find i won. hurrah!
But what if, after two hours, you sent some ships to defend it. If the result was calculated when i sent my ships, your defensive ships would be ignored. If the result is not calculated till you log on, then what if you dont log on? if the result waits till i log on again, you wont know whats happened to your ships in a fight thats already happened! argh!

The only solution i have thought of so far is to keep track of what events every item in the game is involved with. So in the previous example, me sending my ship will initiate a "fighting event", which will be tagged on to my ship and your station. You sending your ships to the station will cause them to be tagged on to the event too. If you move them away before the event takes place, they will be moved out of the event. the first time an involved player logs on after the event, the result is calculated and everyone is let know.

This will work, but seems a little complicated. Considering the fact that a player is in control of a space faring empire, with populations, special characters, ships, stations, planets etc that could all be involved in events, it could all get a bit much.

If anyone out there has any flashes of inspiration, let me know. The thought of coding that bit of the game is making me want to cry.

Posted: August 4th, 2005, 15:40
by Woo Elephant Yeah
I suggest you speak to the PHP Elephant, failing that, I have no clue whatsoever.

/shite with MySQL & PHP

Image

Posted: August 4th, 2005, 15:41
by Dog Pants
Holy shitballs! You're way too clever.

The only help I can give you is encouragement.



*encourages* :thumbsup:

Posted: August 4th, 2005, 16:05
by wyrd
you though of setting up a cron task to do stuff?

Posted: August 4th, 2005, 16:12
by Joose
doesnt cron work at specific times or time intervals though? even if i got it to check for events every 5 mins, someone could easily change something and change it back in between checks.

Unless...could I alter the time the cron task takes place via php?

actually, that could end up with several million cron tasks.

:?

shitflakes!


:x

EDIT: thanks for the idea though, not thought of cron, as ive not really used it before. time to investigate.

Posted: August 4th, 2005, 16:12
by amblin
.

Posted: August 4th, 2005, 16:18
by Joose
Ive just had a wonderfull idea. Possibly.

Turn based! If i make it so there is a set amount of "turns" per day, this whole problem goes away! Possibly not so good, game play wise, but a hell of a lot easier to program.

What do people think? Would a game of conquest be made shite by being turn based? And how many turns per day?

Posted: August 4th, 2005, 16:28
by Vowles
Nope, Most of the best Browser based MMO's work this way. Tried and tested proof of work-age and enjoyability allowing for a complexitiy of the actions of the client.

..... and Good Luck I once helped run a MMO and dyamm....I give it up (Free open source one edited and messed then uploaded :) )

Thats an idea, Download some Open Source MMO's (Code Beach? google?) and lookie what they do?

Posted: August 4th, 2005, 16:29
by amblin
.

Posted: August 4th, 2005, 16:43
by Joose
Right, turn based it is. Yes! then i can just run a cron job every hour to calculate the results of everything! winner!


I hereby declare my undying love to you all!

/gos back to designing tech trees.

Posted: August 4th, 2005, 16:44
by Vowles
Yay!

(And I just made myself a new avatar :D )

and omfg

101 POSTS WOOO (1 Late but hey)

Posted: August 4th, 2005, 17:37
by TezzRexx
I would also like to give encouragement, since as i'm not too sure about anything I've just read.

and woo to mr. vowles and his new chav strike avatar! :D

Posted: August 4th, 2005, 18:03
by spoodie
sounds interesting but over my head too, have some of these

Image

but if you have any questions about cron I should be able to help, not that there's a lot to it, cron is pretty simple

Posted: August 4th, 2005, 18:16
by Renegatus
Dog Pants wrote:Holy shitballs! You're way too clever.

The only help I can give you is encouragement.



*encourages* :thumbsup:
Pfffffffft, ha ha ha! Tea-on-monitor moment.

Posted: August 4th, 2005, 19:06
by Roman Totale
13 replies and so far no-one has suggested CIIJASIIE?

I am disgusted.

Posted: August 4th, 2005, 19:11
by Vowles
CIIJASIIE?

Be this witch craft and now I've read the word Iam hexed unless I send this to 15 people?

Posted: August 4th, 2005, 19:12
by Grimmie
CONGRATULATIONS: YOU ARE CLEVERERER THAN ME. =D

<img src="http://img.photobucket.com/albums/v241/ ... ombat1.jpg" alt="Image hosted by Photobucket.com">

GOOOOO JOOSE!

Posted: August 4th, 2005, 19:30
by shot2bits
Roman_Totale wrote:13 replies and so far no-one has suggested CIIJASIIE?

I am disgusted.
well u just fulfillied that task then didnt you, and everything bout coding went WOOSH!!!

Posted: August 5th, 2005, 9:37
by Woo Elephant Yeah
No no no people, it's now officially CIIJA5IIE*

Cover it in jam and 5punk in it's eye

Posted: August 5th, 2005, 11:32
by Renegatus
Woo Elephant Yeah wrote:No no no people, it's now officially CIIJA5IIE*

Cover it in jam and 5punk in it's eye
Ooh, sticky. Reminds me of a Teddy Bear's Picnic I once went to. I read the sign wrong - it turned out to be Teddy's Erotic Bare Picnic.