Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Go Back   The PokéCommunity Forums > Maruno
Notices

Conversation Between Maruno and Alexandre
Showing Visitor Messages 1 to 6 of 6
  1. Maruno
    September 1st, 2013 06:33 AM
    Maruno
    It's a basic feature of Ruby. It occurred to me when thinking about online battles that the only information you really need to send across are the initial conditions (i.e. the party Pokémon at the start, not the battlers), the chosen commands and any outcomes of randomness - everything else is calculated. Knowing how an RNG works, I then figured you don't even need to send the outcomes of randomness; just sync the seed at the start and it becomes just more calculations. In theory.

    An example of setting the RNG seed is in the Lottery mini-game. Here the seed is set depending on the day, which ensures the winning number is the same on any given day. You'll probably want to randomise it again afterwards to prevent any possible abuse (not that I think anyone will care enough to try it for a fangame).

  2. Alexandre
    September 1st, 2013 02:22 AM
    Alexandre
    I must have missed the random number seed section while analysing the battle system, cheers for that!

  3. Maruno
    August 31st, 2013 04:47 PM
    Maruno
    That sounds like a very unnecessary way of getting online battles to work. If you synchronise the random number seed at the beginning of the battle for all participants, then all random events in the battle will be the same for both players (assuming identical code). This way you only need to send the information about which command is chosen, and play each round locally for each player, knowing that the RNG is playing out the exact same moves for each participant so there'll be no desynching.

    I'm not sure how to answer your question. pbAttackPhase starts the activity and handles retreating and priority calculations. Then for each battler, in order of priority, that battler's pbProcessTurn is run. pbProcessTurn makes that battler use a move. The process of using a move is definitely a jumble of code.

  4. Alexandre
    August 31st, 2013 03:21 PM
    Alexandre
    Not for debugging, for sending over a socket connection. (working on plug and play pvp battling). I figured out that problem anyway. PokeBattle_Battler has an instance variable @battle which refers back to PokeBattle_Battle. When attempting to dump the battler, the battle variable also gets dumped. PokeBattle_Battle contains the scene variable which refers to PokeBattle_ActualScene so in actual fact I ended up dumping the entirety of the scene and logic of the battle. Creating custom marshal dump and load methods for PokeBattle_Battler which excludes @battle (and @moves since PokeBattle_Moves also has a @battle instance variable) solved the problem.

    Also, you wouldn't happen to have a layout of the battle logic and how, in specific, pbAttackPhase maps out the attack logic. I think I have the basics mapped out in my head but its difficult to keep track of, if not, cheers anyway!

  5. Maruno
    August 30th, 2013 04:43 PM
    Maruno
    What would you possibly want to do that for? Debugging purposes? Surely there are better ways...

    You'll have put the dump code in the wrong place. Marshal.dump(@battlers[0]) will work somewhere in PokeBattle_Battle and that's about it. Also, you can't really use that line all by itself - you'll need to open a file to dump it into - check other dumping for examples.

  6. Alexandre
    August 30th, 2013 10:09 AM
    Alexandre
    Hey Maruno, trying to dump the @battlers variable in PokeBattle_Battle with Marshal.dump (in specific @battlers[0]) however I'm getting "marshal_dump not defined for class viewport". I'm aware that Marshal can't dump certain classes however I can't find where viewport is called in PokeBattle_Battler, would you have any idea?


All times are UTC -8. The time now is 08:12 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.