Jump to content
  • Create an account or sign in to use the shoutbox

    You need to be a member in order to be able to chat with other users.

Sign in to follow this  
twostars

Major gameplay optimisations... and general status updates

Recommended Posts

Hey guys,

Since the last status update we've been pretty busy!

We've updated the client to be on par with USKO 2.171, we've rewritten the King system, we've added Castellan Capes and the Castellan Dungeon, we've fixed a plethora of general bugs (present in the official client and otherwise), implemented Darkness item proc/effect behaviour (most notably the Dark Knight Mace, which behaves uniquely in that it allows players to heal enemies to deal damage), improved speedhack detection, and much, much more.

Firstly though, our Halloween event!

As of today's patch, the Halloween event will be over. It's definitely been a fun week. For the most part, I'd say the Halloween event went pretty well. The start was rocky as there was a ton of new behaviour that was implemented for this event (Darkness weapon procs/effects, new exchange behaviour, etc), as well as some issues with our updated speedhack detection, but we worked through it pretty quickly.

Darkness weapons were a bit of a game-changer with PvP, but for merely a week of use (give or take some minor carry-over after the event), it definitely mixed things up a bit. Things should go back to normal soon, as these event items expire. ^_^

The Halloween event also, however, made a fundamental problem with Knight Online's behaviour very clear. With the increased spawns in and around the CZ bowl, players with lower-end PCs / connections were struggling with warping (e.g. Descent and other teleports, like mage Blinks).

Which is where our major gameplay optimisations come in.

Knight Online has many problems. It's not the most efficient game, by far. Stuttering and lag is just expected of it at this point, unless your PC is reasonably high-end and you have a very good connection to the server (i.e. low ping).

This isn't really true for a lot of people who play the game though. Especially with private servers, having a decent ping to the server can be very hit or miss.

So when the server isn't at all efficient about its communications with the player (which it isn't!), it can result in sending a considerable amount more data to the client and forcing it to perform a lot of unnecessary work, which results in stutters and lag while the client slowly processes its requests.

This week, such an issue was highlighted pretty clearly. With the increased spawns in and around the CZ bowl, players were finding increased stutter and lag -- particularly when using warps like Descent.

The reason for this is actually pretty silly, but I need to explain how things work first to properly understand it.

In Knight Online, maps are divided up into regions. Something like:
image.png

Players can only see the contents of adjacent regions, like so:

image.png

In the above, player A can only see player Bplayer C, player D, and player E because they can see regions (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), and (3,3).

They cannot see our perfectly accurate depiction of a worm over in region (4,4), because it is not in an adjacent region.

So when player A crosses into region (3,3)...:

image.png

As you can see, they can no longer see player Bplayer C or player D. We can still see player E in (2,3), and we can also now see the worm over in (4,4).

This should all be pretty straightforward.

Realistically, you'd expect it to despawn players/NPCs/monsters from the regions we can no longer see (those greyed out in the above image), and insert those in the regions we can now see (the darker yellow regions in the above image).

That is, simply make the minor changes to what we know. The problem with its official behaviour is that it doesn't do this at all.

Instead, it officially despawns everything and re-requests everything in its adjacent regions.

Obviously this is extremely inefficient. In the example above, we already knew where player E was. Unfortunately, because everything was reloaded, it had to remove them and we had to be made aware of them... again. In addition to the worm which we previously couldn't see.

This behaviour is pretty bad, but it's worse still for warps and respawning. Both of these not only fully reload when you move to an adjacent region, but every single time. For example: if you Descent to someone right next to you (for the purposes of this example, in the same region), it will still request a full reload of all players (+ merchant stalls), NPCs and monsters for all adjacent regions.

Every single time.

So, we were able to optimise this pretty heavily. We now specifically tell the client only what it needs to know.

For adjacent region changes, that means who we no longer can see, and who we can now see. In the example above, this means telling player A that we can no longer see player Bplayer C or player D, i.e. all players/monsters/NPCs from regions (1,1), (1,2), (1,3), (2,1), (3,1). We also tell player A that we can now see worm over in (4,4).

Anyone else still in our adjacent regions, for example, player E over in (2,3) remains unchanged. We have no need to update them whatsoever, so they no longer get despawned.

For same region changes (e.g. warps), this means we no longer tell it anything -- because it just doesn't need to know. Player A can already see everyone in the region they were at and adjacent regions. They didn't change regions; there's no reason to look for anyone new.

Sadly, requesting all data is entirely official behaviour. This was never purely a problem with ApexKO, or purely the server -- to fix it, we even had to patch the client to let us make these changes.

But why are they so major? This all seems pretty trivial.

It's so major because it's a ton of data the client was always processing, to the point where it having to unload and reload spawns (particularly when there's a lot of them!) causes very noticeable lag/stutter. Again, this is particularly evident with warps like Descent and mage's Blink, especially in highly populated areas (e.g. CZ bowl, especially with our pumpkins from the Halloween event!), but also of course when it's forced to do so from simply moving into another region.

This also inadvertently fixes some other things.

For example, since things aren't being fully reloaded on same-region or adjacent-region warps, or when they move into adjacent regions, nor finally when players are resurrected, loot boxes will also no longer despawn in these cases.

Since loot boxes aren't actually game objects, and only exist when you're nearby to see it drop, full reloads previously removed them. But since there's no reason to reload, they're not actually removed anymore, so you can still see and loot them.

I'm sure there's other behaviour related to this which it will clean up, but for now this will have to do. ^_^

These optimisations should greatly improve gameplay from what you'd expect from even an official server like USKO. Completely removing that lag/stutter from most typical behaviour should be very noticeable and make the game that much smoother.

Thanks again to those who reported the stutter with Descent. These reports are what allowed for some pretty nice improvements to overall game behaviour!

How's the client source project going?

Truthfully, with all the work on ApexKO in regards to its Halloween event and stream of bug fixes for surrounding patches, I haven't been as busy with it as I'd like. That should change though as things begin to stabilise again.

Changes we've made since the last status update include:

  • Cleaning up mouse input behaviour, to behave consistently and cleanly (this also deals with UI focus issues, so you can now, for example, click the chat UI/scrollbar and use the mousewheel to scroll the chat bar, or click back out into the game and return mousewheel behaviour to zoom in/out pretty seamlessly).
  • Implementing UI clickthrough behaviour, for things like the chat bar.
  • Cleaned up UI event behaviour for consistency. There was often cases where this inconsistent behaviour lead to various bugs.
  • Finished implementing all of the King system.
  • Implemented the friends list.
  • Reimplemented chat behaviour.
  • Implemented PMs.
  • Implemented the chat bar buttons.
  • Implemented chat filters.
  • Item names are used consistently/correctly where needed. There were often cases officially, typically in messages in the info box where the wrong item name is used (specifically the name of the item's base), rather than the item's actual name.
  • Updated the trade UI to behave as per 1.298 (with the confirmations, etc).
  • Updated the vendor UI to behave as per 1.298 (with the confirmations, etc).
  • Updated loading behaviour to more closely match official (where the load % is tracked, rather than updated at intervals).
  • Implemented support for stealth / visibility (e.g. Lupine) skills.
  • Fixes alpha blending issues with text and models (these existed in the official 1.298 client, but were fixed in later official versions).
  • Clan symbols on capes now only show if the clan is allowed to use them.
  • Purchase prices are now correctly coloured by price (as with newer clients).
  • Fixed various UI input bug issues.
  • Fixed double-click logic to behave on a per-control level, rather than per-click (i.e. making 2 clicks on 2 different things shouldn't trigger a double-click on the 2nd, e.g. with lists -- clicking one list entry then another rapidly shouldn't fire a double click event).
  • Updates login screen error behaviour to behave as per 1.298.
  • Fixes some issues with rivers / ponds not rendering.

... and more.

In regards to major updates that are left, we still need to implement transformation support (and hence siege weapons), the rental system (although less important), Power-Up Store/in-game browser, quest tracking, etc.

Hopefully when things are more stable with ApexKO, I can start to knock some more of those major features off the list and push it ever closer to a more complete state.

What's next?

Honestly, we still have a lot of our previously mentioned future goals from our last update left. Most likely the next thing we tackle will be implementing UTC, but we'll see what happens. With that game feature (finally!!) in, a lot of our secondary priorities can be looked at (in addition to getting more work done with the client source where possible!).

Until next time. ^_^

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×