The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Development Multiplayer possibility? (https://www.pokecommunity.com/showthread.php?t=257609)

Emcitement July 18th, 2011 1:12 AM

Multiplayer possibility?
 
editout

Jambo51 July 18th, 2011 12:55 PM

You're basically asking if we can make the ENTIRE game co-op friendly?
As far as I can tell, that would be a no... However, there's no doubting it would be f**king awesome if we could.

However, afaik, the code for normal trainer/wild battles would completely freak out. And there's certainly NO way you could battle together.

I'm also 99% certain that most "normal" actions are illegal in the trading environment, so this is probably a no starter, sadly.

Aside: Thanks for the trading info, could be VERY useful :)

I Am Number 3 July 19th, 2011 6:11 AM

Wouldn't the easiest way to see if that would work would be to test it on a ROM you have? I think that it wouldn't work as well as you except. I don't think that in Generation III there was 4 way battles between trainers (feel free to correct me if I'm wrong). But if it is in the game I think that if you did some serious hacking (like ASM) you could trick the game into thinking some computer trainers are human trainers and you could have the four way battle.

So yes, I think you both can walk around, but I don't think you two could battle together or interact a lot.

Cold Ivory July 19th, 2011 9:24 AM

Is the location of that map data (tileset/scripts/etc...) known?

Putin July 21st, 2011 2:33 PM

So... Like for the purpose of racing, or something? Or potentially for solving puzzles?

Also, every version of no$gba's been capable of doing this (linking smoothly that is) as long as I've been using it. I still don't get why there is such a bias toward using VBA as the end-user, though as an hacker I understand its utility, so I am sure there is something I am still missing here, but linking issues were technically resolved ages ago.

Liquid Twilight July 22nd, 2011 12:14 AM

Personally, I was thinking of attempting something like this myself but there seems to be a lot that could wrong. Sounds good though :)

Missingyep July 24th, 2011 12:37 AM

I am going to say something that is going to sound completely irrelevant at first. But it's not. Just bear with me.

Halo: Combat Evolved for the Xbox was ported to the PC by a company named Gearbox. After Halo PC's release, Gearbox released Halo Custom Edition, an expansion that allowed people to create their own maps. It came with a rudimentary map editor, which was quickly hacked, forked, and extended.

Halo maps could contain scripts, NPCs, and the like -- much like FireRed maps. However, none of these things were designed to appear in multiplayer. If you tried to play a map that used them in multiplayer, they'd desync -- horribly. You'd see players drop dead for seemingly no reason, because they were killed by an Infection Form or something on the host box (but on your computer, the NPC was on the other half of the map).

HCE mappers quickly learned something: if it wasn't meant to be used in multiplayer, it probably won't sync in multiplayer. Avoid it.

The same is true here. If it wasn't meant to sync in FR/LG's multiplayer, then it probably won't. Especially if it's random. That immediately rules out wild battles, some OW movements, egg hatching... And by virtue of the latter two, it basically rules out all OW movement (probably desyncs if an egg-hatch stops one player) and collision-checking with OWs (randomly-moving OWs desync across the games, so they could block a player in one emu but not in another).

Now, granted, someone could probably alter the game engine to make everything sync. But it'd be a huge edit. It'd be a complicated edit. Something only one of the master hackers here could do -- and perhaps even difficult for them. Depending on how the current syncing works, they may have to literally rewrite the game engine.

Deokishisu July 26th, 2011 8:28 AM

To reinforce the above point, already when linking, if you talk to the woman in the trade/battle rooms and force her to turn in your game, she won't in the others. The OWs on that map aren't synced, so the OWs on others would not be synced as well.

Though I don't see a huge problem with it, until your linked friend walks on top of an NPC that's standing there in your game but has moved away in theirs. We don't even know if warping will preserve the link, as you don't warp in the normal link rooms while linking.

It is a good idea though, I'm going to try it out I think, just to see what happens.

Deokishisu July 26th, 2011 9:22 AM

Time to post my little experiment!

What I did was edit an otherwise clean FR Rom. I added a connection to Pallet Town from the trade center room in the Pokemon Center, then proceeded to play through both files until I could trade. Linked em up, all looked normal in the trade room (except the added connection of course). I then proceeded to walk both games up into Pallet Town.

I passed into Pallet fine in both games, and they were still linked and I could still see the individual movements of each game's player. The problem was, none of the doors worked, eventually each game's movements desynched, so one player would be in front of the player's house in their game, but somewhere else according to the linked game. The desynching happened primarily when I walked up to Route 1 on one game. Wild Battles didn't work. I eventually got to the point where it desynched enough that the movement permissions were off, giving me some invisible walls. I successfully made it back to the trade room in both games and traded. Then tried again, thinking it as a "refresh" basically. Same deal.

I don't think what you're envisioning is possible on the GBA games. Maybe when we're more versed in fourth gen hacking, you can use the Underground to create your region, allowing anyone to enter and play in it with you.

HackChu August 25th, 2011 1:38 PM

This is most likely impossible. I tried a long time ago, linked the games up and created a map with trees and NPCs. One person would talk to the npc while at the same time the other player could talk to the same person. Basically, you can't do anything at all except battle eachother and nothing else. However if you just want to walk around for no reason, than be my guest.

NarutoActor August 25th, 2011 7:33 PM

I think it would be cool if we limited the co-op. Like both players are transported to one map where they can play in a series of multilayer games. Gen 5 has synched play.

Flowerchild August 25th, 2011 8:45 PM

I think it would be both possible and fun to do this. I've always believed that nothing is impossible, especially in ROM Hacking. If we could use ASM to reprogram the game to be multiplayer...Man, that would be awesome. Also, if we used ASM, it wouldn't have to have anything to do with the Link Room, or even a Pokemon Center at all. I'm gonna talk to some people who know ASM, see if this is at all possible. Because, if it is, I think we should try it, fast.

HackChu August 26th, 2011 9:03 AM

Quote:

Originally Posted by HackDeoxys (Post 6820235)
I think it would be both possible and fun to do this. I've always believed that nothing is impossible, especially in ROM Hacking. If we could use ASM to reprogram the game to be multiplayer...Man, that would be awesome. Also, if we used ASM, it wouldn't have to have anything to do with the Link Room, or even a Pokemon Center at all. I'm gonna talk to some people who know ASM, see if this is at all possible. Because, if it is, I think we should try it, fast.

I'm not all that saavy with ASM, but even than I still think it wouldn't be possible. The game itself would need a COMPLETE overhaul, the battle system, everything.

Flowerchild August 26th, 2011 7:41 PM

Quote:

Originally Posted by HackChu (Post 6820826)
The game itself would need a COMPLETE overhaul, the battle system, everything.

I don't think so. At least not to start with. I though of an idea. So here's how it'd work:
You play normal most of the time. However, the ROM automatically links up with other people playing nearby. You don't join them, however, if you run into them in the field, you may battle, trade, chat, etc. The game would not have to be reprogrammed, it would merely require the ROM to check for other people playing nearby and automatically link with them. You will still find them in the same places that they are currently playing. so your chances of running into them are quite small, given that they can be anywhere in the region.

We can invent more about this later, but for now, I don't think it would be nearly as hard as others imagine.

Missingyep August 27th, 2011 12:58 AM

Quote:

Originally Posted by HackDeoxys (Post 6821659)
I don't think so. At least not to start with. I though of an idea. So here's how it'd work:
You play normal most of the time. However, the ROM automatically links up with other people playing nearby. You don't join them, however, if you run into them in the field, you may battle, trade, chat, etc. The game would not have to be reprogrammed, it would merely require the ROM to check for other people playing nearby and automatically link with them. You will still find them in the same places that they are currently playing. so your chances of running into them are quite small, given that they can be anywhere in the region.

You're oversimplifying.

In order for the game to synchronize an action -- say, taking a step in one direction -- it must send data to all connected clients whenever that action takes place. Those clients, in turn, must be "listening" for that data and must respond to it appropriately -- say, by updating the other players' OWs on-screen -- when it is received.

This must be done for everything that is synchronized. If you need to synchronize wild battles, then the games must be coded to send, check for, and respond to data packets when they are initiated. Movement, trainer battles, random OW movements -- same thing.

Essentially, you'd literally have to hack nearly every facet of the game engine and modify them to make them sync. Failure to hack even one system -- the random movement of NPC OWs, for example -- can lead to massive desyncs in the manner I have described earlier in this thread.

And an auto-connect system like you're describing would require even more work -- constantly listening and broadcasting for additional connections, and synching several connections at a time... Having to spawn new OWs and sync new data at any moment, should a player come within range of the Wireless Adapter... All of this, as opposed to a direct one-to-one connection between two and only two players, initiated with a specific trigger (i.e. talking to an NPC to start a link) and deactivated with another specific trigger.

Full Metal August 27th, 2011 6:51 AM

^ And furthermore, I believe the bandwidth for the accessory port on the GBA is tiny. Maybe 4 bytes, if I remember correctly. So you'd be re-inventing P2P.
Send Header ( 2 bytes ) "Move Change" New ( relative ) XY position ( 2 bytes )
Send Header ( 2 bytes ) "BattleReq" - trainerID ( 2 bytes )
Send Header ( 2 bytes ) "Accept" - trainerID ( 2 bytes ) #global. the one with that trainerID is listening for this after a "BattleReq" or something is sent.
Send Header ( 2 bytes ) "TradeReq" - trainerID
Send Header ( 2 bytes ) "Leave" - trainerID
Send Header ( 2 bytes ) "Enter" - OW type

trainerID is just the order in which player's entered the area.
So basically, you would still need to sync the games ( like they do in the pokecenter )
Then every 1/60th of a second, check for any headers. If there are any that apply to your game, then apply them. However, I see one problem with this: You have more than 1 person. IDK How that would work. Would one message overwrite the other? [ I still have yet to do any actual research on this ]. And in general, it would just be fairly disappointing.

HackChu August 27th, 2011 7:16 AM

Quote:

Originally Posted by HackDeoxys (Post 6821659)
I don't think so. At least not to start with. I though of an idea. So here's how it'd work:
You play normal most of the time. However, the ROM automatically links up with other people playing nearby. You don't join them, however, if you run into them in the field, you may battle, trade, chat, etc. The game would not have to be reprogrammed, it would merely require the ROM to check for other people playing nearby and automatically link with them. You will still find them in the same places that they are currently playing. so your chances of running into them are quite small, given that they can be anywhere in the region.

We can invent more about this later, but for now, I don't think it would be nearly as hard as others imagine.

Thing is...who would you even find near by? I'm sure that us people on this forum are really the only ones who still play these games being that they're a bit old and outdated.

NatureKeeper August 27th, 2011 5:55 PM

8|

Nothing is impossible. You just need to know HOW-TO-DO-IT. If the multiplayer system can be repointed AND hex edited, that would be possible. The game already has data for 2v2 battles, and multiplayer movement, they can be edited to fit the requirements. However, all other things need to be synced, which would probably piss everyone off before finishing. It is brutal to do, but is possible.

TL;DR : Base Hex Editing.

Missingyep August 27th, 2011 8:16 PM

So here, off the top of my head, is a few things that would need to be synchronized for multiplayer to run stably outside of the Union Room.

Wild/Trainer battles and their effect on the overworld
If Player A gets into a battle in tall grass (or with a Trainer), code will need to exist to alert Player B, so that attempts to talk to A fail appropriately ("DAVID is in a battle!"). Player B can still move around while A is battling, so when A finishes, he'll need to resync everything.

Problems can arise if B starts their own battle while A's is already in progress -- particularly if A finishes before B. In that case, A will need to resynchronize with B even though B is mid-battle.

So there are two approaches. Synchronization of overworld data can be made possible in the middle of a battle; only one player can be allowed into a battle at a time; or some sort of "cooperative Double Battle" mechanic can be coded, such that if one player enters a battle, the other is dragged in.

NPC OWs: movements and interactions
Movement of NPC OWs will have to be synched. This may mean a modification of the part of the game engine that handles OW behaviors ("Look around", "No Movement", etc.).

If Player A talks to an OW, and Player B attempts to talk either to A or to that OW, then a message will need to be shown for Player B ("They appear to be busy right now." or some equivalent). This is without taking the OW script itself into account...

If a player talks to an OW, the effects of that script -- applymovement, etc. -- must be synched. Running the exact same script for both players would not make sense, however (Player A talks to someone, and Player B suddenly gets asked if they want to buy an Egg by some random guy on the other side of the city). Some commands would also produce obvious issues with synchronization (warp, for example -- especially if it warps to a specific X/Y coordinate).

The solution would be to make some script commands sync, but not others. Things like weather can and must sync, whereas things like preparemsg can't. The effect is that of the two players, only the one that triggers the script runs the script -- and the commands themselves trigger synchronization of any relevant data. This could also have the beneficial effect of allowing both players to run scripts independently of each other but with synchronization, although if the scripts are contradictory (i.e. both changing the weather to different values) some issues could arise. That would be the kind of contradiction that the scripter could be trusted to avoid, I think.

Hidden items (as Signpost scripts)
If Player A picks up an item, should Player B still have access to that item on their overworld? Or should it vanish from both worlds, thereby granting a reward only to the first player to claim it?

If the latter, then code will need to track and sync all flags related to hidden items. The relevant flags -- and only the relevant flags, lest something that should not sync end up synching -- would need to be synchronized when their states change. This would produce problems when the two players connect: which set of flags should be propagated to both games?

Visible items (as Poke Ball OWs)
The same issue, but with the added problem that if the items' states are not synched, then a tile may end up being walkable to one player but not to the other.

...

I'll stop now before I give myself a headache. This idea may as well be impossible. The number of things that would need to be synchronized, managed, and carefully tracked is massive.

leews24 August 27th, 2011 8:27 PM

I'm not much of a rom hacker,
but wouldnt it be somewhat different if we modify the emulator(vba)
Mod the gba rom engine itself to connect not to a seperate emulator,
But a seperate server?
I mean, Gamboys can do it with a bit of a mod,
Why not the emulator?

Come to think of it, we'd might end up reconstructing the gba, instead of modding

Flowerchild August 27th, 2011 8:47 PM

Quote:

Originally Posted by HackChu (Post 6822189)
Thing is...who would you even find near by? I'm sure that us people on this forum are really the only ones who still play these games being that they're a bit old and outdated.

Well, you have a point about that. I dunno.

Quote:

Originally Posted by NatureKeeper (Post 6823080)
8|

Nothing is impossible. You just need to know HOW-TO-DO-IT. If the multiplayer system can be repointed AND hex edited, that would be possible. The game already has data for 2v2 battles, and multiplayer movement, they can be edited to fit the requirements. However, all other things need to be synced, which would probably piss everyone off before finishing. It is brutal to do, but is possible.

TL;DR : Base Hex Editing.

And probably not worth it, though.

Quote:

Originally Posted by DavidJCobb (Post 6823270)
So here, off the top of my head, is a few things that would need to be synchronized for multiplayer to run stably outside of the Union Room.

Wild/Trainer battles and their effect on the overworld
If Player A gets into a battle in tall grass (or with a Trainer), code will need to exist to alert Player B, so that attempts to talk to A fail appropriately ("DAVID is in a battle!"). Player B can still move around while A is battling, so when A finishes, he'll need to resync everything.

Problems can arise if B starts their own battle while A's is already in progress -- particularly if A finishes before B. In that case, A will need to resynchronize with B even though B is mid-battle.

So there are two approaches. Synchronization of overworld data can be made possible in the middle of a battle; only one player can be allowed into a battle at a time; or some sort of "cooperative Double Battle" mechanic can be coded, such that if one player enters a battle, the other is dragged in.

NPC OWs: movements and interactions
Movement of NPC OWs will have to be synched. This may mean a modification of the part of the game engine that handles OW behaviors ("Look around", "No Movement", etc.).

If Player A talks to an OW, and Player B attempts to talk either to A or to that OW, then a message will need to be shown for Player B ("They appear to be busy right now." or some equivalent). This is without taking the OW script itself into account...

If a player talks to an OW, the effects of that script -- applymovement, etc. -- must be synched. Running the exact same script for both players would not make sense, however (Player A talks to someone, and Player B suddenly gets asked if they want to buy an Egg by some random guy on the other side of the city). Some commands would also produce obvious issues with synchronization (warp, for example -- especially if it warps to a specific X/Y coordinate).

The solution would be to make some script commands sync, but not others. Things like weather can and must sync, whereas things like preparemsg can't. The effect is that of the two players, only the one that triggers the script runs the script -- and the commands themselves trigger synchronization of any relevant data. This could also have the beneficial effect of allowing both players to run scripts independently of each other but with synchronization, although if the scripts are contradictory (i.e. both changing the weather to different values) some issues could arise. That would be the kind of contradiction that the scripter could be trusted to avoid, I think.

Hidden items (as Signpost scripts)
If Player A picks up an item, should Player B still have access to that item on their overworld? Or should it vanish from both worlds, thereby granting a reward only to the first player to claim it?

If the latter, then code will need to track and sync all flags related to hidden items. The relevant flags -- and only the relevant flags, lest something that should not sync end up synching -- would need to be synchronized when their states change. This would produce problems when the two players connect: which set of flags should be propagated to both games?

Visible items (as Poke Ball OWs)
The same issue, but with the added problem that if the items' states are not synched, then a tile may end up being walkable to one player but not to the other.

...

I'll stop now before I give myself a headache. This idea may as well be impossible. The number of things that would need to be synchronized, managed, and carefully tracked is massive.

Well yeah, you're right about that. I guess it'd not be worth it to make, at all. Especially given HackChu's point (that there'll probably be no one close enough to talk to anyways). So...are we just gonna abandon this?


Quote:

Originally Posted by leews24 (Post 6823281)
I'm not much of a rom hacker,
but wouldnt it be somewhat different if we modify the emulator(vba)
Mod the gba rom engine itself to connect not to a seperate emulator,
But a seperate server?
I mean, Gamboys can do it with a bit of a mod,
Why not the emulator?

Come to think of it, we'd might end up reconstructing the gba, instead of modding

I don't really understand what you mean here.

Missingyep August 27th, 2011 8:54 PM

Quote:

Originally Posted by HackDeoxys (Post 6823293)
I don't really understand what you mean here.

I think he's suggesting that we find a way to create some sort of dedicated server for PKMN Advance multiplayer. Which is not how it works at all...

leews24 August 27th, 2011 9:18 PM

Quote:

Originally Posted by DavidJCobb (Post 6823306)
I think he's suggesting that we find a way to create some sort of dedicated server for PKMN Advance multiplayer. Which is not how it works at all...

I know that, since I think I've described this wrong.
By "server" I meant more a of a bridge between two emulators, or just build it on to the vba. sorry, my english ain't the best.

Anyway if that makes no sense, forget what I said.

Missingyep August 27th, 2011 9:22 PM

Quote:

Originally Posted by leews24 (Post 6823340)
I know that, since I think I've described this wrong.
By "server" I meant more a of a bridge between two emulators, or just build it on to the vba. sorry, my english ain't the best.

Anyway if that makes no sense, forget what I said.

That actually does sort of make sense. But unfortunately, it would be even more difficult. It would require asynchronous networking (or it would be insanely laggy), and I'm pretty sure that the existing functionality is synchronous.

U.Flame August 28th, 2011 9:27 AM

Why haven't I seen this thread before? I tried the exact idea of making hacks co-op friendly. Obviously it didn't go well and many things weren't functional at all. If there is any possibility, some major hacking is required. But I settled for replacing the simple link rooms with one huge area filled with activities, adventure, and multiplayer-friendly events. Progress wasn't too bad but I gave up for a while due to lack of proper testing and help.

If anyone is interested, I can try to release another team thread for it. (The last one had ZERO replies the whole month.)

VBA has a thing where it can connect to IP addresses for linking, pretty much making games wi-fi compatible right? I can see how that can be expanded to make a server. I don't know the first thing about making that sort of thing but I hope people who do can try it.


All times are GMT -8. The time now is 8:59 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 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.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 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.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.