nb Core Community
May 22, 2012, 04:44:03 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: 1.2.3 +nb is now final and released

@new registrations. I will not allow any new registrations here as there are more (real person) spambots here than ever.... captcha proved to be ineffective.

After your registration, mail me at ( admin AT shinobilegends.com ) from the mail address you want to register. Provide some text about you and possibly your game.
 
   Home   Help Search Calendar Downloads Login Register  
Pages: [1]
  Print  
Author Topic: Delayed battle outcome (for themed games)  (Read 1701 times)
Alchemion
Guest
« on: October 12, 2008, 10:44:03 am »

Hi,

You probably got to know my keen for delayed forest access, delayed pvp fights, delayed torments and so forth...

We had some motivations about the right and smooth way of doing this... and it occured to me :

Preventing players from easily and continuously accessing fighting areas would solve a general game issue that is the game load... one basic movement is the translation of the players into the game forum, totally separated from the game database, so that it does not count for game load...

Yet, there is an issue with the timeout lodge mission module that we have discussed it, complete it and attached it to some other thread on this forum : the set timeout somehow may discourage players from returning from the forum to the game (fighting) areas, thus creating an issue...

I see the solution to this issue in delaying also the battle outcome, along with delaying (the timeout) the new fighting areas access...

    Basic idea is that when player hits the "fight" option (probably directly modified from settings, to "until end"), in forest, graveyard or pvp, he is blocked navigation to other options and corresponding links, for a set timeout, excepting the "return to $links" navigation...
    the player will see the result of the battle ONLY WHEN the timeout expires and ONLY WHEN s-he is returning to the left fighting area (or the result may also be sent by mail)...
    this will work like a derogation (exception) from the badnav navigation... so, the player is allowed to leave the fighting area (which has started directly "Until the end"), but WHEN s-he is returning to that area s-he will be displyed the rested timeout if any, if no timeout left, s-he will be displyed the battle outcome and be allowed navigation to another fight options (slum, seek, look...)

    Now, is this idea "hookable" into the badnav schema ?....

    I am awaring of the fact that this battles will be specialtyless and other pet, mounts commanded attack less... but this would be an alternative to a themed game....

    So, please suggest any more ideas and code hints for the possibility of making this or improving this...

    Looking with great interest for your replies and insights on the matter...

   Thank you very much.
« Last Edit: October 12, 2008, 10:47:37 am by Alchemion » Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 307



View Profile WWW
« Reply #1 on: October 12, 2008, 11:54:24 am »

Instead of suggesting a "hack around the battle principles" (which is different from "letting users do a fight only once X minutes) for delaying fight outcomes (you have to delay the entire fight - not just the outcome) you should think about a modular way.

Honestly, I have little clue about your game setup - and what you describe can only be understood by somebody who plays on your server - I do not.

If you want to fiddle around with displaying timeouts - check out what I did with ajax ... mail*.php in the root lotgd directory.

I used the xajax framework ... and hook into it in the lib/pageparts.php ... it's not easy to understand, but as you have my implementation you should be able to extrapolate it.

So you do NOT have to hack the badnav principles, which NEED to be intact in order to let the site be sane.
you can do any module that overrides the forced nav...
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Alchemion
Guest
« Reply #2 on: October 12, 2008, 01:33:20 pm »

If I delay the entire fight along with the outcome, it's exactly what i have already obtained with the actual missionsearchtimeout etc module...

The "skepsis" is to delay the outcome, separated from the fight, so that players would be eager to "Wait for the uncertained outcome", not just simply "wait" for another battle, as they do now with the actual timeout module...

While thinking about solutions, I thougt of an alternative : I may let the battle happens as it does now, with help from specialties, from monts, companions etc, BUT, when displaying the LAST FIGHT RESULT (battle victory or defeat), the battle outcome display itself should be suspended until timeout runs out...

A message would appear so that players should walk along and come back for the result...

Or, simply break the battle outcome message display, let the battle finish "in the background / on the server" and when timeout runs out, let the system send an e-mail to the player, with the debugged battle outcome.... the message would be triggered by the player movement throgh the game, not relying on the server separated countdown... if the player stops playing or quits to the field, the message would be triggered/sent when he s-he logs again...

of course, if the outcome led to death, the daily news left menu would be triggered when timeout runs out, along with the debugged battle outcome message sent to player...

... should i hook the battle timeout to battle victory and battle defeat ?...
« Last Edit: October 12, 2008, 01:37:45 pm by Alchemion » Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 307



View Profile WWW
« Reply #3 on: October 13, 2008, 08:20:22 am »

Well.

You can only do so for "fight until the end" ... else he will know his last fight round what happened.

well. you can, in +nb, do nasty things. as you want to hack - there is no real other way to do this - you can re-route the page display.

of course, skills are required.

Here is what you have to do (I hope you understand what you need to do):

-> hook into forestfight-start
-> check or alter the fight to last until the end
--> replace the global $output with a NEW output object (search in common.php how I set one up) and don't forget to SAVE the $output object. else you will have problems...
--> hook into battle-victory and battle-defeat
-> switch the $output back to the one you stored at the forestfight-start location. the output saved in YOUR output object is now the entire fight - excluding navs, only the outputted stuff for the main window.
--> leave him in your own nav if you want now for an infinite time (the only nav a "Refresh" with a timer or so)
--> display him the content of your output object when time is due

basically, what to do is simple.
realistically, it's very hard for you to do.

as said, I think of it as a hack - it tries to break the fight system apart. Even then you have the reduced amount of HP visible + can see a difference in EXP - and also if you're already dead =)
If you want to do it differently, there is only one choice:

Recode the entire battle system on your own, and fetch all values there in a temporary variable - and then at the of fight apply all happened stuff when you think it's due (check - condition).

No other way possible.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Alchemion
Guest
« Reply #4 on: October 13, 2008, 09:05:21 am »


Quote
Even then you have the reduced amount of HP visible + can see a difference in EXP - and also if you're already dead =)

Also the gems, gold, powder and other findable stuff should be temporary suspended...

Well, i think of a re-routing on win-loss condition... the player may fight one turn, 5, 10 turns or until the end... excepting fighting till the end, the first options may be also took into consideration as ok, and only when win/loss rusult should appear at the last fight click, the outcome should be blocked... stored in user's session and restored when player returns at the place of the fight, along with being sent by mail as battle message....

If this is easy for you, then I suggest you plant a Paypal button somewhere on nb-core.org, so that I and other interested fellows should reward your efforts and your time spent for the community... Smiley

Name a price for this themed change (YM : spiritofword) ... if the amount is outpassing my hobby's allocated budget, I may be forced to hobby some more Cheesy
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 307



View Profile WWW
« Reply #5 on: October 13, 2008, 03:27:37 pm »

^^ thanks for the offer.

however what you suggest would be a new battle system, not more not less.

You would have to make the entire battle temporary, storing the results. And then hope the user does NOT get into a village special gaining or losing HP, it would be bad =) same with losing gold - he can simply spend all and lose none.

Needs to be checked.

Hence you would need to copy and adapt the battle.php / lib/forestoutcomes.php and other files into a new battle module where you handle everything - replacing the forest.

^^ my dilemma is an easy one: I have no time and obligations ... for instance to legendofbleach.com, my second server - where I have to do a new weapon system ... which is halfway done.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Alchemion
Guest
« Reply #6 on: October 13, 2008, 04:02:41 pm »

Quote
he can simply spend all and lose none.

if the player spends his gold ... the player may get into minus or negative status on gold, gems and so forth... some kind of "bank credit".... by the measure s-he earns more gold (ie.) s-he will cover the "debt", getting over the negative status... banking code may be used...

Quote
I have no time and obligations

don't we already know that ?!... did I ask you a quotation or did I affirmed that an equivalent needs to be named ?...
Logged
genmac
Guest
« Reply #7 on: October 13, 2008, 08:17:47 pm »

If the sole reason you are doing this delayed modification is to decrease server load, it might be easier and better to use memcache instead - it will speed your database up by quite a bit and can be run on almost any server.

However the db_query functions would need a rework to work with memcache (making the calls to memcache if available) - if I happen to do this myself I will post it on dp and/or here.
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 307



View Profile WWW
« Reply #8 on: October 13, 2008, 08:53:36 pm »

if the player spends his gold ... the player may get into minus or negative status on gold, gems and so forth... some kind of "bank credit".... by the measure s-he earns more gold (ie.) s-he will cover the "debt", getting over the negative status... banking code may be used...

So you want a new game ? because you would go as deep as database fields - gems are not negative, so is exp and whatnot.


Quote
If the sole reason you are doing this delayed modification is to decrease server load, it might be easier and better to use memcache instead - it will speed your database up by quite a bit and can be run on almost any server.

However the db_query functions would need a rework to work with memcache (making the calls to memcache if available) - if I happen to do this myself I will post it on dp and/or here.

I use eaccelerator, which pre-compiles PHP ... very nifty.
As for datacaching - well, the file system can handle the cache files - plenty of reads, little writes... works out good so far.
http://www.danga.com/memcached/ <--that sounds nice, though.

But: you are platform depent - or need at least decent root server knowledge - webhosting won't work.

Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Alchemion
Guest
« Reply #9 on: October 13, 2008, 10:29:39 pm »

memcache and eaccelerator... i  would use both of these... both seem useful...

yet the delayed battle outcome still is not moded.... Cheesy

I see the delayed battle outcome as a part of a different themed game, not especially for reducing the server load... though that would be an extra gain...

so...
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 307



View Profile WWW
« Reply #10 on: October 14, 2008, 07:18:51 am »

So, either you build your own battle system... or your own game engine =)

As said, it's a pretty bad hack if you want it core, and I certainly will not make such a thing into core - the bugtesting alone means weeks/months as it is spread all over core.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Alchemion
Guest
« Reply #11 on: October 14, 2008, 07:35:54 am »

I think I will pass this type of battle idea, for now...

I may hire into a new battle system, but that remains on a TODO list... any coding offer negotiated...

Thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!