PK++ Progress 07/02/07

NETCODE
========

Interpolation FIXED! (finally)

What seems to be the case, is that part of the player animation was causing a glitch which resulted in the player location on receiving the player frame to be mislocated. This is now fixed by turning off animation until I get more time to look at it. Right now animation is synchronised, but I am considering having this predicted on the client.

What this means in real terms is that gameplay at low data rates will be smooth. Since PCF did not understand what interpolation was, it broke as you set serverframerate(client) less than the actual server frame rate. This meant that low serverframerate(client) looks very jerky/choppy. It should be noted too that enemyprediction also damages movement on the server.

Given this, I can now interpolate ALL moving items between frames, so everything is smooth.

The important part here is that serverframerate(client) can be much less than the server tick rate. It is considered that good physics occurs on servers set to 60 fps, but 60fps of data for ffa is too much. By lowering serverframerate(client) you can still have 60fps on the server, and still have smooth, low bandwidth gameplay.

By comparison, Q3 and CS both use 20 updates to the client per second (although due to server tickrate), although HPBs can lessen this if required. Gameplay is still smooth on both these games, and no one notices the additional latency caused by the interpolation. It is possible to correct for this using unlagged/anti-lag which PK has the foundations for already. Whether we go for full client-side anti-lag or not will be decided in due course.

Where PK loses out is hiding things you cannot see from the update. The way Q3 works is to only update players which you might be able to see/hear, and not ones way off in the distance. We cannot yet do this in PK, and cannot without the source code. I may have to think of other ways to reduce data if required. If the main issue is reducing data for COOP, then simply I can not update monsters which NO ONE can see or hear – they will still be there on the server though.

I also loaded up Q3 to compare upstream and downstream packet sizes, and PK and Q3 are now similar.

MAPS(!)
=======

SP maps are beautiful, and if in any doubt load up C2L5_Town or any and see how good they look on full detail. However, a number of the maps do not work on dedicated server – and in fact crash PK out completely. This is the reason, for example, why there are no conversions of City on the Water which is a great map.

The loading problem is now FIXED! (this is important!)

ALL SP maps can now be used on dedicated server, which should also fix some issues found by mappers 🙂

Also when loading SP maps in MP now, the items which do not belong in MP are not loaded (such as monster Ambush). Player respawning can now take place from monster respawn points which seem nicely distributed. The intention is that for SP maps which are obviously not set up for MP, items will be placed by code. Generally the level exit will be replaced by a teleport to start – much like Q1 did. This forms a loop of what is initially a linear map. Other item placement issues will be considered later – but what is most important is that the loading of ALL maps into MP works and makes sense.

COOP
=====

More work was completed on AI Brain, but essentially I need to work through each monster, making sure they do not assume a single SP player, and can instead attack one of a group of players. I am not worried about this at all.

I suggest that we have around three type of COOP: SP COOP (SP game with more than one player), MP COOP (ffa with monsters), and COOP Arena (all vs. monsters).

MOUSE
======

I have written my own mouse code, which reduces mouse lag, and adds mouse acceleration and smoothing as required.

MONSTER AND ITEM SCALING
========================

I added two more parameters to the \addthing and \addmonster commands, firstly the number of things/monsters added at once. This seems to lag out clients with larger numbers, so I may have to add them over several frames.

Secondly I added scale to both. It is great fun playing with the scale of various items. In fact our test map, DM_Boss, can quickly become too small, so Killua has made another test map without walls. A 200xscale Panzer_Demon for example is awesomely impressive. Even normal monsters resized to boss-size are worth seeing.

NEXT STEPS
==========

With interpolation out of the way, other fixes are relatively easy, so I should be quicker with them. There may be some hacks of the exe/dll I might want to do, but other than that you should see more progress soon!

Leave a Reply