DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • November 16, 2018, 12:14:24 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Online PVP  (Read 7287 times)
0 Members and 1 Guest are viewing this topic.
lonnyl
Guest
« on: February 20, 2004, 06:25:20 AM »

I have read a great many discussion on Online PVP and how impossible it it to do.  I have discussed this with moejo and we have come up with some idea and ways of maybe making this happen.  The first thing is that there would need to be a challenger and challengee script with the challenger one merging and controlling the battle.  I think buffs should be enabled for online PVP .  Now the timeout thing is a big problem, I see the best solution as being a 60 second timeout and if the other player has not responded the script of the player still playing takes over and automates the rest of the battle.  The automation code would have to be in both scripts, and a warning posted to both players that they need to click before their 60 seconds are up.  Now when they click they shoulc be taken to a page that refreshes every 5 seconds and is checking for data in the online pvp battle table (I believe there would need to be a seperate table for this kind of interaction) and when both players have clicked or the timeout limit reached it displays the results page with the appropriate navs to continue fighting.  

what issues have I missed and how can we deal with them?
Logged
strider
Guest
« Reply #1 on: February 20, 2004, 09:31:29 AM »

Okay, here's a few things I'll toss in.  .  . first, with stateless PHP I really don't think ONLINE PHP is going to happen very easily and this might not be the way to pursue it. I know you're going after the MUD like game, but since LOGD is turn limited and "Death" is something that occurs if you enter the wrong choice (i.e. you get yourself killed either in a fight or in an event), how will you handle it with PVP? Right now, when someone PVPs, even if they die, they're not online and it doesn't count against their daily HP nor their turns. If you die in online PVP, are you dead? I'd say yes.

Next, several boards have longer than a 60 second timeout, (mine included) so you have to remember to shift it down then shift it back up to the default. A small issue, but one to keep in mind.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #2 on: February 20, 2004, 11:31:30 AM »

Well,
 Right now, I have it setup where you can PvP online characters, but the scipt is automated on the challenged person side. I honestly think this is about the closest you can get without being detrimental to the game.
Logged
strider
Guest
« Reply #3 on: February 20, 2004, 03:07:12 PM »

You might be right there.
Logged
lonnyl
Guest
« Reply #4 on: February 21, 2004, 05:06:08 AM »

Just to be clear the timeout I was referring to would be in the code for the online pvp and would not be attached/related to the timeout for the rest of the game.
Logged
anpera
Guest
« Reply #5 on: March 18, 2004, 08:51:00 PM »

Well, maybe there is another way to do it.
Right now I'm working on a PvP-Arena where online PvP *should* be possible as a nice side effect. I hope I find some time for it this weekend.

It came up with the idea of PvP with special moves. To keep it fair both players should be able to choose what special move they use and when they use it during the fight. So I dropped all ideas of automated fights with or without tactical 'programming' right before a fight. Player 1 should make his move, then player 2 can fight a turn, then again player 1 and so on. To prevent trouble with timeouts or one player blocking the other, all fighting is done with 'frozen' character information in an extra area called "the arena".
That means: Player stats are saved into an extra table at start of fight and all fighting in the pvp-arena is done with that values. So both players can leave arena and can fight their normal days until the other player did his turn in arena. All they do after the fight startet has no influence on the battle anymore. A fight starts, after player 2 accepted the challenge of player 1. He has time to think about it as long as his level doesn't change or as long as player 1 is holding the challenge.

Planned features:
- Full use of all special abilities, mounts, and other buffs during PvP.
- The winner gets some experience and the fee both players pay at start of battle.
- The loser loses some experience but he won't die.
- A dragonkill of one of the opponents ends the fight ahead of time.
- Players can do their "normal work" if the opponent is offline.
- Players are forced to fight their round if it is their turn on new day.
- Online PvP is possible if both players are online at the same time but it is not compulsory.
- Spectators can watch the battles running in arena.
- Maybe later (if I ever make the above run) a system to place bets on winner could be added.

Problems till now:
- how to display 'frozen' character stats in arena (dont' want to change common.php too much)

I'm full of pleasant anticipation to see fights with mystical powers against thieves and skeletons fighting stallions and such. Smiley
About 10% done right now.

If anyone finds a problem with this or has additional ideas just let me know
Logged
strider
Guest
« Reply #6 on: March 19, 2004, 04:38:35 AM »

Sounds great Anpera and I must admit tis a better approach than I had thought of.

Perhaps a secondary "arena" table being used like a special vars table specifically for fighting will store enough of the battle stats.

When you initiate a fight, assign a fightID and a snapshop of player1
when player2 accepts, assign the same fightID and a snapshot of player2.

The ONLY problem is that player2, if smart will buff up their character before fighting, therefore creating an imbalance in their favor.

If you create two snapshots the moment Player1 Challanges. . .then why would player1 pick anyone they weren't confident they could beat (as they do now)...

So, depending on the order the of the snapshots, perhaps there needs to be some extra advantage or governing factor to initiating the fights.

Thoughts? I think the answer may be to force accaptance of a challenge in the NEWDAY.PHP. That way, Player2 only has the remains of the day they were challenged to accept the fight.
« Last Edit: March 19, 2004, 04:40:44 AM by strider » Logged
lonnyl
Guest
« Reply #7 on: March 19, 2004, 04:49:00 AM »

Seeing that it is supposed to be online PVP, I thing bot people need to be online, and in the module to initiate a fight.  Which means a challange would have to expire as soon as the callanger left the arena.  What we need to deal with is the timing out errors, or logging off errors.  Which I think turning the fight into something automated, or yes just delaying the fight to a your turn my turn thing.   I still belive that one could set a couple minute timeout (in the module) and then at that point the module takes over for the missing player.  I do like the idea of no death for the looser, and the profit from the battle being the entry fee's.  And Just like the Battle Arena I made, there should be a reining champ.   The module taking over can be a little unfair, however I don't like the idea of battles taking days....  and betting on a battle that took days would stink, and then how would you set the odds?   Just some thoughts.....  
Logged
strider
Guest
« Reply #8 on: March 20, 2004, 09:03:05 AM »

Here's the problem mate, it is what it is.

PHP is stateless, so I suppose you could write something in Java or even use ASP to a certain degree to do what you're requesting, but my knowledge of PHP (which isn't vast), doesn't have a solution to allow two players to really fight live without unleashing some rather unhealthy exploits.

Logged
anpera
Guest
« Reply #9 on: March 20, 2004, 08:29:25 PM »

@strider:
You explained almost exactly how it works:
Player 1 challenges Player 2. In that moment a snapshot (that was the word I was missing) of player 1 is saved into an extra table AND some values of player 2 like level and acctid are also saved. (A fightID is not needed, for every player can only take part in one fight at a time so acctids are enough to identify a fight. In script I'm working with "goodguy" and "badguy" arrays built from pvp table. Changes on accounts table are only necessary to save stats of how often someone won or lost a challenge.)
Player 2 now has time to buff up a little bit and prepare for the fight. If he gains a level the challenge is dropped. I don't think this is unfair because player 1 can buff up before fight as well and he is the one who chooses his (mostly weaker) opponent. As soon as player 2 accepts the challenge the rest of his stats are saved in the pvp table. A challenged player has no possibility to challenge another player without declining the first challenge. All this is working without errors already. Smiley

The idea of forcing player 2 to accept the challenge on newday is not what I want, because therefore - like lonnyl said - both players must be online at the time of the challenge.

The way I'm using in pvparena.php looks great till now. I fought another testchar online round by round the first time today Cheesy . Got some trouble with buffs and a "division by zero" somewhere but I'm too tired to find this bug now. I couldn't use battle.php because of automated badguy and AutoFight so I need to get through all battle code at first Shocked
Code for what happens after the fight is not written yet.

Instead of waiting in a place for the other players turn or for timeout, with pvparena you will be forced to enter arena from village square and fight as soon as it is your turn. What you're doing before and after your turn is left to you.

I think all this is the closest you can get to fair online PvP with PHP.
Logged
strider
Guest
« Reply #10 on: March 21, 2004, 01:34:55 AM »

That sounds like the most logical way to go. Building a Battle2.php   . . . in that regard, maybe look back to the older Battle.php before autofight and your other flavors were placed in to streamline it some. People wouldn't need that functionality for the Online PVP.
Logged
anpera
Guest
« Reply #11 on: March 28, 2004, 06:41:00 AM »

Just to tell you how work is going on:

I still have some trouble with some buffs that affect opponent's attack and that activate themselves after opponents turn, but the rest of it is working fine. Both players in a battle force each other to fight because there is no way to reach village square when it's your turn to fight. To prevent trouble with timeouts etc. the whole battle is done with copies (snapshot from beginning of battle) of the characters like described above. So if one player goes offline the battle will continue after he's back. The other player can play his normal life in LoGD until player 1 is back.
A battle can be done online as fast as normal PvP (without AutoFight) or it can take several days if players aren't online at the same time. A dragonkill of one of the players ends the battle without a winner. Same with one player being deleted.

I was about to release it when someone noticed that a few buffs aren't working the way they should... Roll Eyes
Logged
anpera
Guest
« Reply #12 on: April 05, 2004, 11:14:31 AM »

Done. I think.

Translation anyone?

http://dragonprime.cawsquad.net/users/anpera/pvparena04042004ger.zip
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #13 on: April 07, 2004, 03:09:20 AM »

I passed it off to one of my players to see if he could translate it.  I will let you know how that goes.
Logged

anpera
Guest
« Reply #14 on: April 12, 2004, 09:41:25 AM »

Ok, thanks a lot.
I have done the translation right now. Uploading .... Smiley
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
41 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search