Giter Site home page Giter Site logo

srmeier / knightonline Goto Github PK

View Code? Open in Web Editor NEW
211.0 48.0 117.0 274.13 MB

OpenKO is an open source version of the old school Knight Online MMORPG

License: MIT License

C++ 63.98% C 21.99% Makefile 0.06% Lua 5.64% HTML 5.22% Objective-C 0.12% CMake 0.01% JavaScript 1.54% CSS 0.24% C# 0.23% ASP 0.21% PowerShell 0.76%
game mmorpg directx sdl2 knight-online

knightonline's Introduction

Open Knight Online (OpenKO)

We started this project to learn more about how the MMORPG Knight Online works. MMORPGs are very intricate programs requiring knowledge in many areas of computer science such as TCP/IP, SQL server, performance tuning, 3D graphics and animation, load balancing, and more. Starting with the original leaked source we have updated to DirectX 9, wrapped window creation and player input using SDL 2.0, added function flags so that various file formats may be supported while remaining backwards compatible, and much much more.

The goal of this project is to replicate official client functionality while preserving accuracy and compatibility with the official client. We do not intend to introduce features not found in the official client, nor introduce custom behaviour in general. You're very welcome to do so in forks however, but these do not mesh with our design goals and introduce complexity and potentially incompatibility with the official client. Essentially, in the interests of accuracy, we'd like to keep the client's behaviour as close to official as possible, where it makes sense.

We may deviate in some minor aspects where it makes sense to fix, for example, UI behaviour, or to provide the user with error messages where the client may not officially do so, but these changes do not affect compatibility while improving the user experience. Pull requests for such changes will be accepted on a case-by-case basis.

This code is for academic purposes only! If you have questions, or would like help getting started, feel free visit the forums.

Note:

  • The UIE project currently requires VS15 pro

Intentional design decisions:

  • The project is currently focused around supporting the 1298/9 version of the game. Version 1298/9 has most of the core functionality attributed to the game’s success. By ignoring later versions of the game we keep the system relatively simplistic. This allows us to strengthen the fundamental components of the game while minimizing the amount of reverse engineering necessary to make things work.
  • We stick to the 1298/9 database schema. To ensure compatibility with the 1298/9 version of the game we do not modify the basic database schema. This means the structure of the database and how information is stored in the database doesn’t change while we are working. This could change once the core functionality of the 1298/9 is in place.

knightonline's People

Contributors

coskun avatar d5dl2 avatar demircivi avatar doogej avatar forcepower avatar giladreich avatar madpew avatar mjsamet avatar ohad258 avatar onurcanbektas avatar srmeier avatar twostars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knightonline's Issues

Issues with DirectX in N3ME

The GUI for the N3 Map Editor is having issues rendering the DirectX scene.

A few notes:

  • DX gets initiated in CMainFrame::OnCreate()
  • If you prevent the DX initiation CN3MEView::OnDraw() gets called, otherwise it doesn't seem to

Anyone looking into this will need a version of VS6.

Implement zone effects

The OPDSUB controls this.

In particular I'm referring to the green border effect around the arena zone's (48) safe area.

WIZ_CLASS_CHANGE subopcode 6 needs implementing

Once you've completed your lvl 10 quest you must relog in order to see your skills. It'd be nice to have the job change to complete online. Almost seems like a bug with the quest at first because I forgot this was an issue with the original KO.

Mob HP in Release

Is there a reason that the mob hp points are displayed over the health bar in release? This isn't normal to have in release.

capture

Some issues with the standard EVT codes

So the original EVTs for zone 21 (Moradon) have some incorrect codes. What the NPC says (things like "you have to be level 10 or above" or "would you like to retry this quest") doesn't match up with what actually happens in the EVTs. This isn't an issue with the converter because the LUA code matches what the EVTs say to do but the EVTs are just wrong.

This issue is just for NPC Isaac in Moradon but unfortunately I'm sure this is an issue all over the place...

Issue with N3Sky not being large enough

So I believe a lot of people are familiar with this issue

pic00

Turns out if you just make the render billboard larger it fixes this problem.

pic01

Just opening and closing this issue so the solution gets documented.

After completing a skill quest, e.g 70 skill, there is no data sent to server in order to save the status

In Lua scripts, the corresponding event just checks the the necessary item, robs them and save the quest to the state 2 and that is it, but somehow client know that and does the skills available to the user.However, since there is no data sending and saving, after re-login, the skills becomes unavailable again.

What is or what should be the logic in here ? Any idea would help.

Note that, I'm using binary client.

The reason why I am writing in here is that since it a open source project, the important discussions should also be open to everyone, I think.

Strange variation in player's collision box

Noticed strange variation in the player's collision mesh (image below)

  1. The player's box immediately following login (Moradon)
  2. Using the wrap gate to travel to CZ
  3. Using the wrap gate to travel from CZ to Moradon

A vary peculiar issue.

untitled

Mouse3 event during gameplay

In 1299, when you click mouse3 key of your mouse camera turns by 180 degrees. Client doesn't have this feature.

LoginServer pulls from static / hardcoded LoginServer.ini versus dbo.SERVERS

Current setup of LoginServer is setup in LoginServer.cpp and hardcoded to populate the LoginServer.ini (see debug/release bin).

References:
LoginServer.cpp : void LoginServer::GetInfoFromIni()
UILogin.h : struct __GameServerInfo : public binary_function<__GameServerInfo, __GameServerInfo, bool>

Assumptions:
Populate LoginServer list using dbo.SERVERS table from KN_online database instead of ./LoginServer.ini (CONF_LOGIN_SERVER)

Matching the GetNpcInfo packet with the source client's MsgRecv_NPCIn packet

This is a quick fix and good for someone new to the project. First find the "CNpc::GetNpcInfo" function in the Npc.cpp file of the GamerServer project. This function creates a packet containing all the Npc information to send to the client. This is the correct packet structure. Make a note of the structure of this packet and then open up GameProcMain.cpp in the WarFare project. Find the "CGameProcMain::MsgRecv_NPCIn" function and rewrite some of this code so that the client is getting exactly what the server is sending.

If you have any questions please post them here!

1264 Combat packets

There seems to be an issue with some of the combat packets for the 1264 client. My first guess would be to start investigating the WIZ_ATTACK and similar packets. This could also just be an issue with the binary client and could be a bug on MGame's part but I believe incorrect packets is a more likely scenario.

image of info panel

Missing "(Reduced)" indicator for when an item has a reduced requirement causes sprintf() to fail

So I noticed this when attempting to hover over an item in my inventory. The client displays a tooltip showing all the item's stats. Now that the strings have been corrected (big thanks to @twostars) the correct formatted strings are being used. However, when the tooltip is calculating weapon requirements it should factor in whether the item has been reduced via the anvil and if it has it should print "(Reduced)" next to the integer stat requirement. The old client apparently doesn't have this feature implemented but, unlike most features, this should be a super easy one to implement!

Because I ran into this while debugging other issues I'm going to put a blank string as a temporary fix and address this again in the near future.

Issue with users missing "AfxVer_.h"

User "Lost" on the forums came to me with the issue:

"Cannot open include file: 'AfxVer_.h': No such file or directory"

This was a simple fix by just commenting out almost everything in "StdAfxBase.h". We don't use most of that stuff anyways.

Few more issues/bugs

1)"X" (escape) button is not working seems we need to add this manually
2) same goes for "B" Button which is work for target the near npc behind you.
3)"H" button is not working seems again we need to add this and add ui H menu.
4) You can't buy anything from npcs but in particular if u buy potion from a npc the game server nd client will crash saying moradontax is nullptr we will need to take a look in the gameserver function as well in the client.
5) While you kill monsters excpet from "Worm" all the others dont drop anything besides money and u dont see the Box of the drop - in the first place u was able to loot the money but it didnt notifcate that u get any but I fixed that on my latest commits but the aboves bugs are still remains I hope i will have time to continue working in this very weekend.

Using GLM for 3D structures such as vectors, matrices and quaternions

I was thinking to use GLM for 3D structures such as vectors, matrices and quaternions, which are defined in My_3DStruct.h file by using directx library.

I have already started experimenting with the library, and wanted to take your opinion.

So what do you guys think ? Should we use it ? Do you have another suggestions ?

Let me know your thoughts.

Preventing Duplication in EvtConverter output

I think we can make the LUA script equivalent of the EVTs smaller by checking the previously processed tag to see if it's identical to the next tag and ignore the duplication. Right now in the LUA script we get a lot of the below example because of how the EVTs work. This should be easy to prevent when converting the files.

local state = pUser:SearchQuest(30);
if state == 1 then
local state = pUser:SearchQuest(30);
if state == 1 then
-- stuff
end
end

Obviously if the outer if-statement is true the inner statement will also be true lol. So we should prevent these kind of duplications from happening. (We also need to write it so that everything gets indented correctly; just makes it easier to read.)

Implement tile events

In particular, safe zones (amongst others) -- e.g. in the arena zone's (48) center area.

Upon first moving onto a tile (or spawning in on one) it'll show:

7642	This is a safe zone.

To the info box.

Resource.h

The id's in resource.h do not match up with the supplied Text_us.tbl file that's in Client\data\Data. Version 1298 of the Text_us.tbl matches. This causes the incorrect lookup of messages that are displayed. For example, logging in with an incorrect user displays id 2903 which is text str "Cannot equip because of your high level" instead of "No such registered ID". Replacing the Text_us.tbl with the 1298 version fixes this issue.

Missing models

Some NPC and Monster models are missing.
E.g. Moradon Sundries
image
image

User gets kicked after starting beginner's quest

The player gets kicked after starting the beginner's quest in Moradon. Here I'm using the source server + binary client on an Orc Rogue.

Binary client players typically get kicked when the server sends a "SendDebugString" to the player via LUA script. For the source client this LUA function sends a packet containing the debug string which gets added to the info panel.

So we are most likely missing a EVT to LUA function conversion here.

Zone entry notices

These pop up in the middle of your screen in a yellow text stating the zone's name.

The same thing's used by other things such (from the newer clients) Oreads' buff areas. I'm sure it's used for others in older versions too, but that's the only thing that comes to mind.

Issue equipping Rogue Shirt (+3)

Level 4 Rogue Orc is having issues equipping the Rogue Shirt (+3) item. I have a feeling that the item has a level requirement which doesn't show up in the item description, so the player goes to equip the item but the server rejects the request to equip because the player isn't high enough level. Need to find the function which gets called when the server receives the packet for equipping an item.

Access violations

ekran goruntusu 8

ekran goruntusu 6

Sorry for the Turkish VS2017.

In the first image it says that:
"at 0x017... on KnightOnline.exe a special case thas occurred.
0xC000... : Write access violation at position 0xCCC... "

And in the second image, it says that:
"Exception occurred: read access violation.
CN3UIWndBase::m_sRecoveryJobInfo.pItemSource is nullptr."

I often face with the errors in the first image, and they generally happen at some specific lines of code.

There is no Command window.

In 1299 you were able to reach commands like "/greeting" etc. from Command menu as you can see below.
By the way, when you type "/greeting" into chat screen greeting animation happens.
image

Of course they're many commands which were used in common.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.