Page 1 of 4

Client source upgrade - more than just a new look

Posted: Fri Sep 09, 2016 8:54 pm
by Mike
While completing the work on some of our interfaces (like the GE), I had noticed a couple of minor bugs. For one, when the GE tells you "You have bought X items for Y coins", it actually shows how much you offered for the items, not how much you actually paid (if you offer 100M for a whip but someone was already selling one for 80M, you'll spend 80M but the GE will say you spent 100M). It's purely visual and has no effect on the use of the GE, but it's still a bug.
I had to make a change in the way it's stored in our database in order to keep track of how many coins you *actually* paid for an item, so this displayed information will now be correct.

While doing so, I decided to make a couple of other changes. For example, I decided to let the GE also keep track of how many 100M tickets you have put into it.
I've allowed the GE to accept 100M, 500M and 1B tickets and any 500M and 1B tickets you spend in the GE are automatically converted to 100M tickets (conversion is free anyway). When you withdraw at least 100M in coins, it'll automatically try to take the tickets you had put into it. When a sale happens on the GE (with a value of at least 100M for the whole transaction), it'll also transfer the appropriate amount of 100M tickets if possible. This also means I have removed the code that converts 1100M coin stacks to 1B tickets, instead the GE will always give the tickets and/or coins that were put into it in the first place (but it'll only give 100M tickets, no 500M or 1B tickets).

I also managed to improve the GE search function by grouping any offers for an item with the same price together. You can still easily distinguish your own offers from those of other players.


I also needed to do a few code changes in the shops for the update, but a lot of shop-related code hadn't been updated since 2008 and it was a complete mess, so I decided to also completely rewrite that (Dylan had already started rewriting our shop code a while ago, but hadn't gotten very far yet). Players should barely see a difference in shops, but now it should be much easier for us to add new items (and there are far fewer chances of bugs now) and every item will have a fixed shop price, rather than being 115% of the high value of ::prices. Alching and selling to the junk store will still be based off the ::prices value, but we have a safeguard in place to make sure the alch/junk store value of an item is never more than 50% of the price it's being sold at in a store (but only if it's sold in a store). Shops will now also be loaded faster, meaning I've shaved off a couple fractions of a second on the server startup time.


Lastly: whenever the server starts up, it had to load every single clan chat and every single GE offer (including all old & canceled ones) from the database. I've now rewritten them, so that only all active GE offers are loaded on server start (canceled offers are only loaded on player load) and clan chats are only loaded into the server when needed. This, coupled with the change in shops, has reduced the server startup time with more than 5 seconds, so players will definitely notice the increase in update speed with future updates.

I do however need to test most of these changes yet, but it's looking good so far. The way I'm rewriting most of it actually makes it far less prone to bugs than it is now.


Up next: Clan chat interface, GWD killcount interface, PC interface, expanded friends & ignore lists and a couple of bugfixes related to chat & yell. These should mostly be copy-paste from our own code, but of course it's hard to tell how much time will be spent fixing bugs. Those are the last of our custom interfaces, then I can move on to dumping the world map for noclipping checks. Hopefully I may also be able to do a few pathfinding improvements, but as you all know, that's a really tough thing to do so again I can't make a whole lot of promises on the results.

Technically, I could release it when those three things are done (5 interfaces, chat bugfix and noclipping checks), but the client doesn't have an auto-updater yet and is missing a couple of options (10x hitpoints, new hitmarks, new/old HP bar settings). I can release it without, but I'm not entirely sure yet. I'll keep you posted.

Re: Client source upgrade - most than just a new world

Posted: Fri Sep 09, 2016 9:01 pm
by Armyruler
Awesome work Mike, Keep it up!

Re: Client source upgrade - most than just a new world

Posted: Fri Sep 09, 2016 9:17 pm
by Matthew
Looking good, can't wait !

Re: Client source upgrade - most than just a new world

Posted: Fri Sep 09, 2016 9:40 pm
by Cat
Looking so good. I really like the improvements to the GE, you've really put in some work Mike, thanks for this. I can't wait for the future client. Goodluck on upcoming tasks and fixes.

Re: Client source upgrade - most than just a new look

Posted: Fri Sep 09, 2016 10:03 pm
by Jon
Awesome work Mike, can't wait to use the client!

Re: Client source upgrade - most than just a new look

Posted: Fri Sep 09, 2016 10:05 pm
by Srczm
i actually cant wait, good job sir

Re: Client source upgrade - most than just a new look

Posted: Fri Sep 09, 2016 10:17 pm
by Strdargoba
Yay! No more lost money for putting in 1b ticks in ge now! Looking good though Mike, keep it up! Can't wait for the new updated client! :P

Re: Client source upgrade - most than just a new look

Posted: Fri Sep 09, 2016 10:42 pm
by Iron midas
Very exciting :mrgreen:

Re: Client source upgrade - most than just a new look

Posted: Fri Sep 09, 2016 10:56 pm
by Alex
Good shit Mike. :thumbsup:

Re: Client source upgrade - most than just a new look

Posted: Sat Sep 10, 2016 5:12 am
by Skiller
looks awesome mike. one quick question: you've edited the code so that clan chats are only loaded as needed, why not do the same for grand exchange offers etc.?

I personally barely use the ge. would much rather buy and sell with a live person. If we can load when needed that should cut the time even more, correct?

Just something to think about! Thanks again, so excited for this new client!