• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Overriding PJ64k's Kaillera Client to add AQZ/more features

donkey.KONG

Smash Rookie
Joined
May 5, 2012
Messages
19
can you make it so we can rearrange the order of the servers in the "local list" (move them up and down)?
Of course. You're talking about the offline list that's saved to a flat-file containing a list of Kaillera networks, correct? Obviously this list will need some other improvements besides sorting.

I despise the current GUI entirely, and when I make any changes to the GUI for some reason Owna's resize code makes everything just look out of wack. This in combination with some of the control issues we're having with RichText has convinced me to restart the GUI from scratch using the wxWidgets control library. wxWidgets even has a very nice socket layer, but I am very hesitant to change socket modules without causing any desync implications, so I will most likely just change the GUI controls to use wxWidgets and leave the socket layer untouched.

wxWidgets has a lot of awesome features, such as animated emoticons in chat, background images in all controls - if we had a graphics designer, we could come up with a killer GUI using these updated controls. I'm ok with Photoshop, but I don't want to get too distracted with the GUI because there's simply too much code that needs updated. Perhaps we can introduce this concept later using skins.

This will not be a copy-paste job because the whole core is built around these crappy windows controls. The trivial part will be making sure the client stays in sync with 0.13 despite all the core improvements, so I'm still testing with a p2p 0.13 client after every little change I make to ensure nothing is broken, because I am far from a Kaillera expert. Speaking of which, is Project64k meant to be ran on Windows only? I hope so, because the wxWidgets library I'm using is the Windows version and I'm not sure what results would incur from running it on WINE. I also don't even know how many of you use PJ64k with WINE, or if it's ever been possible, so let me know if this is an issue.
 

firo

Smash Ace
Joined
Jul 27, 2008
Messages
600
Location
Champaign, Illinois
I also don't even know how many of you use PJ64k with WINE, or if it's ever been possible, so let me know if this is an issue.
As far as I know PJ64k works on WINE, but a very few, if any, people actually use it to play. I don't think it is an issue.

I recall hearing that mupen64k has better WINE performance.
 

M!nt

Smash Champion
Joined
Jan 26, 2011
Messages
2,087
I've tried it on wine and it crashes so much its not even worth it. A lot of plugins also don't work. This is one of the main reasons I am still on windows.
 

donkey.KONG

Smash Rookie
Joined
May 5, 2012
Messages
19
Is the latest 1.6 Project64k source available? There are changes I need to make client-side beyond the kaillera dll to address some bugs.

Updates
- when redesigning the GUI for wxWidgets, I had an idea for a button specifically for connecting to The Galaxy. From my experience The Galaxy is the most popular N64 Kaillera server, but some may not agree with this. So maybe we should have an Options dialogue with a checkbox 'Autoconnect to Galaxy.' Please post any GUI or Options requests you have here. Now would be the time to implement them.

- in the p2p host dialogue, there is now a list of servers that mimics the list in the main interface. The purpose of this is the optional broadcast. It will need to know a server to broadcast the game info to, but due to the way the Kaillera server is designed this will require an established UDP connection with the server. Hopefully this will not impact the benefits that p2p offers with more bandwith being used. Maybe we can add a server-side variable just for p2p broadcasters, to force the server not to send them redundant data (such as the userlist, gamelist, chat, etc). Either way this was necessary to establish a ping/pong between the p2p server and the kaillera server.

- with the new wxWidgets GUI, the bug 'You must close all Kaillera windows first!' when trying to close Project64 (despite all Kaillera windows being closed) has vanished. I myself have found this annoying on many occasions, forcing me to close PJ64 from task manager. Not anymore.

- with the adoption to wxString, a buffer overflow prevention string class that comes with wxWidgets, the majority of the buffer overflow exploits in the existing Owna client are no longer an issue. I saw a blogspot that referred to Kaillera hacking and many of the alleged hacks were buffer overflow exploits. I am pleased to inform you that these exploits are no longer a reality. Improved security ftw.

- implemented gamelist filters. Now you can optionally ignore all games you do not have installed in your ROM directory. You can also specifically filter out p2p matches, aqz matches, or kaillera matches. Chats are not affected by this filter yet.


To-Do / MISC
- since the author of the AQZ topic seems to be ignoring my request, I've been thinking about a method to approach the AQZ broadcast. This is my idea: to bind the AQZ plugin to an additional plugin I will write so that both libraries are loaded simultaneously. However, in order for this to work, people will need to update their AQZ plugin to my new binded one that will essentially be hacking in GUI elements. Alternatively, I could position the window slightly above/below the AQZ window and just add more options. Maybe we should make the client check for which AQZ version the user has, and if they don't have the updated one, load an unbinded secondary DLL; if they do have the binded one, just load the binded DLL. This is the best solution I can think of after a lot of brainstorming and I am still not satisfied, so hopefully before I get to this point we can work something out with the author.

- since the wxList widget can list images in it's listbox control, maybe the gamelist can be improved with default images for select games. i.e if a user loads a Mario Kart game, there would be an image of the Mario Kart game displayed next to it's list item. The disadvantage of this would be the list items would have to be more spaced apart to give room for the image. Right now it's just an idea, and goes against my initial goal of reducing the client size, but I'm still up for any and all GUI improvements.
 

donkey.KONG

Smash Rookie
Joined
May 5, 2012
Messages
19
- fixed bug when the client is improperly kicked from a game. The bug showed that you were still in the game even though you were booted, forcing you to click 'Leave' before you can see the gamelist again.

- about 35% of the core has been rewritten for the new GUI. The widgets will automatically skin themselves according to your operating system, i.e. XP users will see XP styled controls and 7 users will see 7 style controls etc. The previous kaillera client did not have this manifest. So far it does not desync more as far as I can tell, but sometimes it's hard to tell since it desyncs so often.

Speaking of this, I'm going to add a lot of debugging to the chat log and try to isolate the cause of desyncs. I had an idea for SSB64 to determine the player's X and Y position on the screen, and send this information to an updated kaillera server. Then player 2 will send their own game's X and Y for player 1 and the server will determine if the coordinates are far enough off, then it's desynced.

I'm more familiar with x86, but I believe the architecture for N64 games is MIPS which is very different. I took a similar approach to detect desyncs in GTA:SA, basically the clients all send their information to the server and the server will determine if the information does not match across clients.

note: this is just a desync detection method, not quite a desync prevention method like I would like. Perhaps if we had an efficient detection system, even if it's specific to each game, we could work on isolating the cause and maybe save a slot slate and reset the game then load the slot state to resync the game.

an automated system, if it worked correctly, would be a lot better than people randomly starting to jump off the edges, then someone pausing and typing "ds" then everyone dropping.
 

dandan

Smash Lord
Joined
Feb 11, 2009
Messages
1,373
good work,
the problems with kaillera are the main reason i kind of stopped playing,
and i was too lazy to fix them myself, keep up all the good work.
cannot wait to see the first stable release.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
What exactly are you doing, here? Is this a new client or also a modified emulator? What exactly are you doing to the emulator, if anything, to make it work with the client?

If you're working with 0.13 and are going to do something permanent to it that the majority of users will subsequently adopt, I have a better emulator for you to use in place of regular ol' 0.13.

Of course, if there's something especially work-intensive you're doing to the emulator and you've already started, I won't ask you to "port" the work over to another emulator. But if it's something simple, then it would be amazing if you could use X instead.

wxWidgets has a lot of awesome features, such as animated emoticons in chat.
Please either don't include these or allow them to be disabled. Also, any change to the special characters (unicode) that are going to show up?

One more thing, since you haven't mentioned it yet... With the current client, there's a way to become "locked out" of game chat for a game you've joined. If you join a game, switch the view to the game list (Swap button) and then attempt to join a game, the Swap button will be replaced with the Create button and you will be unable to see your game chat without reconnecting to the server.

The game must be one which, if you weren't hosting another game, you could have joined—in other words, it must be one on your list, or a *Chat or *Away. Attempting to join a game not on your list or attempting to create a new game won't incur this bug.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
wats wrong with animated emoticons
They're ugly and distracting.

Speaking of which, are text emoticons automatically turned into graphics by this wxWidgets? Because that's even worse, even if the graphics aren't animated.
 

Battlecow

Play to Win
Joined
May 19, 2009
Messages
8,740
Location
Chicago
What exactly are you doing, here? Is this a new client or also a modified emulator? What exactly are you doing to the emulator, if anything, to make it work with the client?

If you're working with 0.13 and are going to do something permanent to it that the majority of users will subsequently adopt, I have a better emulator for you to use in place of regular ol' 0.13.

Of course, if there's something especially work-intensive you're doing to the emulator and you've already started, I won't ask you to "port" the work over to another emulator. But if it's something simple, then it would be amazing if you could use X instead.
.
What's X? I personally don't like any of the substitutes for .13 that have shown up. Smasher's stuff is all buggy, I can never get 7E to work, etc.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
What's X?
I honestly have no idea. The readme calls itself a "hack" but also claims it's based on the Project64 1.6 source, which is ostensibly impossible, and yeah. All I know is that it's an emulator that runs better than 0.13/VE/7E. Something to do with plugin hacks, maybe.

I personally don't like any of the substitutes for .13 that have shown up. Smasher's stuff is all buggy, I can never get 7E to work, etc.
Well, you can see for yourself. I don't claim anything like this being based on 1.6, or whatever, just that it's noticeably smoother in places where the other emulators aren't.

http://www.mediafire.com/download.php?u6sva2vcqin7ilu

It's a mystery to me.
 

donkey.KONG

Smash Rookie
Joined
May 5, 2012
Messages
19
I have not made any emulator modifications. I am editing Owna's code repository that Firo directed me to earlier. In it's current stage, it's more of an overhaul. I have removed a lot of redundant code and functions, rewritten the core into a more object-oriented fashion, and don't worry - wxWidgets supports UNICODE, and all I'll have to do is link to the unicode libraries so people can continue using special characters.

Another good feature of wxWidgets is multi-language support, so with some work I can implement Japanese/Chinese/Korean/etc, just depends on what areas play the most. We'll get to that stage eventually, but keep in mind I've been the only person making these changes to the kaillera client, so progress is slow but steady. I've made sure after every build to keep testing with 0.13 users to ensure the potential of desync does not increase at all.

In fact, I have obtained (through looking around the MIPS decompilation of the Super Smash Bros ROM) the Player1/Player2/Player3/Player4's X and Y position. I am now in the process of updating the client to locally read these addresses, convert them to a float position value (it's a wacky coordinate system so bare with me), and the next step will be to introduce some SSB64-specific desync detection straight into the latest EmuLinker server. This means that people playing SSB64 over the Kaillera network will automatically be informed (properly) of a desync because the clients will all be locally sending the player's positions to the server, and if the server detects the values do not match, then obviously a desync has occurred.

The next step would be to find a way to "reset" the game, perhaps by saving a slot state to the Character Select screen, so that all players would be back in sync just by resetting the game and loading the slot state. The last game's stock options, item switch, etc should all remain the same as the slot save will automatically save at character select. Basically, in the event of a desync, the game will automatically reset to the character select screen - across ALL clients connected - with a synced game.

I don't know whether or not this will work yet, as I've previously stated I'm not very familiar with the internal workings of the emulator, however if it doesn't we can simply automatically close the game and restart after all clients have dropped. This usually fixes the desync but I'd much rather keep the game open and still make it work.

Obviously this would only work for SSB64, but honestly that's one of the few that I play and a lot of this work I would like to dedicate specifically for that game. I don't want to exclude other users, but I can't promise the same desync detection and prevention for other games unless we really dig down and find the true cause of them to eliminate them entirely (or at least reduce).

I won't work on any emulator updates until I have a stable release of this kaillera client. I know the community would like it as soon as possible, but we are still in very early stages and it still needs excessive testing to a dedicated testing team (which I will assemble soon under Firo's guidance). The last thing I want is a leak of an unfinished progress, which I have encountered in past projects. In SA-MP an unfinished client was released that had a lot of bugs, and some members of the community thought the release was real and left because of this.

Smasherx74 has nothing to do with this project, neither will his client hacks. From my understanding he is a code thief and would likely put his name all over my work, so I've rejected his request of joining my development team. As far as the animated emoticons go, I'll probably have it disabled by default but in the GUI options dialogue you will be able to enable them (as well as the other languages, etc).
 

Sempiternity

Smash Lord
Joined
Sep 11, 2010
Messages
1,695
Location
Connecticut
The next step would be to find a way to "reset" the game, perhaps by saving a slot state to the Character Select screen, so that all players would be back in sync just by resetting the game and loading the slot state. The last game's stock options, item switch, etc should all remain the same as the slot save will automatically save at character select. Basically, in the event of a desync, the game will automatically reset to the character select screen - across ALL clients connected - with a synced game.
This would be very cool. Desyncs aren't all that bad in the grand scheme of things, but what really grates my nerves is the need to exit out of everything and restart. I don't mind having to restart games, because I just enjoy playing, and recovering from a desync isn't playing. Resetting to the character select screen would be ideal, and this is probably a lot to ask, but is it in any way possible to reset to, say, the last time somebody lost a stock? Obviously you can't be making save states too often, as that'll slow up the game, but saving a state during downtime would be ideal. Not sure if it's possible to detect these "downtime" situations, though.

Also, do you have any input on the whole 18.5 minute lag out thing? It seems like after a certain amount of data is sent, the emulator just kicks everybody out. Do you know what could cause this and if it could be fixed?

Smasherx74 has nothing to do with this project, neither will his client hacks. From my understanding he is a code thief and would likely put his name all over my work, so I've rejected his request of joining my development team.
Good man. Pretty funny that he asked to join your development "team". I've done a bit of digging and found this:

Youtube said:
Kazuhiro789 commented:
You may want to put smasherx74 since thats my name and im pixle892 i went on this old account to comment. First of all, You don't even know how to ****ing wave dash or L cancel. You have no idea how to play the ****ing game and you actually put FAKE in video LOL you fail so much.
It appears Pixle892 IS smasherx! Even better is this! So he's denied the 1.6 source access, and still goes off and claims he created an emulator based off of 1.6 here. Looks like there's your Project64X+, King Omega!

Also, more lols here. Oh smasherx, always stealing others' work and passing it off as your own. It's a wonder everybody hates you and your credibility is absolutely rock bottom.

I'd just keep an eye out, donkey.KONG. Whenever you release something, be sure to do something to the code to make it known that it's yours. It'd be a real shame if a project of this magnitude was stolen by smasher.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
That would be irritating if it were true. For all you know, that was him just further claiming someone else's work. I'm doubtful it's really anything done by Smasher because...well...it's an improvement. I don't think Smasher knows how to code a countdown, let alone "hack" the way P64 handles plugins (or whatever X+ does that's different).

donkey.KONG, if it's just a new client DLL, then using X+ or not is a non-issue. But, the important part out of my two posts is definitely this...

With the current client, there's a way to become "locked out" of game chat for a game you've joined. If you join a game, switch the view to the game list (Swap button) and then attempt to join a game, the Swap button will be replaced with the Create button and you will be unable to see your game chat without reconnecting to the server.

The game must be one which, if you weren't hosting another game, you could have joined—in other words, it must be one on your list, or a *Chat or *Away. Attempting to join a game not on your list or attempting to create a new game won't incur this bug.
I haven't seen you mention this, so I'd like to bring it to your attention or make sure you're already aware of it so it can be fixed.

donkey.KONG said:
don't worry - wxWidgets supports UNICODE, and all I'll have to do is link to the unicode libraries so people can continue using special characters.
Well, I meant in terms of adding more. Most people's name are ****ed up beyond recognition with the current set, so hey, why not go all the way?
 

donkey.KONG

Smash Rookie
Joined
May 5, 2012
Messages
19
This is the object-oriented style I am porting this kaillera client and server into, for anyone remotely interested in helping with development.

The core of the client should be in it's own class, i.e. the CCore layer. All the internal attributes and variables that are used across all layers of the client will be placed here.

Then the individual types of online play would be derived from a Game layer, i.e. the CGame layer. This would have it's own set of shared variables used across all types of online play, one thing that would be found here is the player pool. The player pool would be an array (the size of the MAX_PLAYERS variable derived from it's parent CGame) of Player classes, i.e. CPlayer. Each CPlayer would be an object-oriented class that would individually contain all of the player-specific variables and functions, such as the kaillera context switch that sets p1/p2/p3/p4 controls, etc.

The GUI layer that controls the listening callbacks as well as the creation, destruction, etc will be derived from the CCore and likely started at the constructor of CCore since this would be the best time to create the GUI. All of the wxWidgets code will be exclusively linked to the CGUI class (remember it's CCore::CGUI) so that outside of this class, i.e. the CGame class, there are instances of which the GUI will need to be invoked. In this scenario, instead of calling into the wxWidgets functions, the CGame layer would obtain the CCore object:

psuedo code
Code:
CGame::CGame( HOST_IP_T m_HostIP, GAME_TYPE m_GameType, ... )
{
    int port         = atoi(m_HostIP.port);
    WXSTR_T ip = m_HostIP.ip.get_wxString();

    // other game initialization 
    if ( (m_pCore) && (m_pCore->GetGUI())
    {
        m_pCore->GetGUI()->CreateDialogue("A new game has been loaded!", SIZE_OF_DIALOG, ... )
    }
}
The network should have it's own layer, separate from the Core and Game layer. It will contain the data processing functions, network variables, kaillera netcode processing, etc.
 

SSb64champ

Smash Cadet
Joined
May 7, 2018
Messages
64
Can anyone do something similar to what this guy wanted to do? atleast upgrade kaillera GUI with WXwidgets or QT? If no one else can do it ill look into doing it by myself with my ZERO programming experience once i get my new pc next week.
 
Top Bottom