• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Source's custom OT game engine (TypeScriptFTW)

Hi, I have a lot of free time now but I don't want to join the team too much.... I'd rather just do some source code development when I'm bored for training purposes.

offtopic: or do you know of any old edition of OTS 7.1 that is unfinished and has a small amount of source code?

ps. I have a small question, do you have any trouble reading the code when you use the prefix ‘this’ a lot?
There's no team, tasks, demands, applications, or pay to worry about.
There's just me working on my server and my willingness to include everyone that wants to be, and if they don't want to be, that's fine too.

No, unfortunately I'm not aware.

No, I prefer to use this in C++ classes to be explicit, so you don't have to wonder if there's a local variable with the same name or not that you're accidentally referring to.

Cheers.
 
Hey everyone. Lots of updates this time.

  • Depots now work (both loading and saving/unloading lockers)
  • saveAllPlayers has been fixed (it was untested and didn't work when I did test it), but it's still somewhat bugged, so I need to work more on it; specifically saving saving inventories, which seem to be a generic issue with containers right now, since fresh monster containers are also bugged
  • Poison damage should happen sometimes when reaching armor even if no damage
  • Fixed laggy walking
  • Translated protocolparse and all onProtocol* events to C++, fixed translation, and implemented everything so it works
  • Implemented world.moveObject and other pos.x == 0xFFFF functions in C++ such that we can move items in and out of containers still while using C++ functions instead of scripting
  • Lots of new functions and reorganization/rework of code

Gif of depots working:
9A46Srr.mp4


PS: After I implemented depots, memory usage has gone up for loading all 64k players from approx 600MB to 2GB + 1GB for map/NPCs/monsters.
This might be partially due to a bug, since memory usage is kinda inconsistent, or it's possible that this is the final memory footprint with 65k characters.
However anything other than the "Zanera" experience won't use this much memory at all, 1GB will be the baseline.

Cheers!
 
Hey everyone. Time for another bi-weekly update:

Not a lot has changed this time, but there are some changes:
  • Implemented checkMoveUse partially in C++ (simplified logic) and added Collision and Separation event on login and logout
  • Implemented RSA and XTEA in C++ using GMP for RSA (from scratch)
  • Developed new AI standalone server which will be run on separate VPS / dedicated, so it doesn't spend all the CPU resources on gameserver; almost everything finished except for MySQL to communicate with TaoEngine and a few finishing details
  • Gathered 25k lines of non-cheating training data for the neural net. Now working on my macro scripts and client to gather 25k more lines of cheating data to train the network.
  • Added pretty much everything to client for this update. Client will exit automatically in 5s if it can't connect to AI server but is connected to game server
  • Only thing left to do in regards to anti-macro nn now is adding MySQL to AI and TaoEngine servers and refuse to accept connections from clients which aren't connected to AI server and disconnect players if they disconnect from AI server or sends invalid data

Keep in mind, while AI server might sound scary, it's the least privacy invasive solution to cheating that exists.

Unlike other servers we're not spying on your processes, we're not taking screenshots of your desktop like supposedly a certain other server and anti-cheat systems.
We're not logging your data, we're not saving your data, etc, whether that's on the upcoming test server or on alpha launch or on stable launch or anything.

All that's done is user inputs are buffered and sent to AI server for evaluation, which means technically the AI model keeps some translated reminiscence of the data in memory which is probably unrecoverable / very unfeasible to actually recover even if you're a three letter agency, if the network thinks you're cheating this incident (name of character / account id and probability of macroing by the neural net) will be logged so that a GM can investigate the issue (might also temporarily ban account if probability of macroing is sufficiently high enough, we will experiment to see).

And the AI network is trained by us and run locally, we're not telling on you to ChatGPT, lol.

So there's no data being forwarded to any other models or servers, just to our servers, running our own model built from scratch using PyTorch.

Think of it like a robot lawnmower. A robot lawnmower only knows how to cut grass. A robot anti-cheat network only knows how to tell if user is cheating (macro pattern detected).
Robot lawnmower goes brrrrr, oops object collision reverse, brrrrr.
Our anti-cheat network goes brrrrr, 0% cheating, 0% cheating, 70% cheating, omg 100% cheating, ok 0% cheating again, brrrrr.

Ok, anyway that's all, thanks for reading any of this, and until next time have a good one :)
 
Hey guys. Time for another update :3

Unfortuntely due to imgur not letting me upload videos/gifs there won't be any screenshots, but I'll make a list of changes since last time:

  • Full SQL schema
  • Started adding SQL - in both login server and game server (just minutes ago) mapping players to accounts based on a SQL query with a bunch of joins to select world and account_id with shasum256 computed in C++
  • SQL class is also implemented fully in C++ (currently using mysqlpp, but have made small steps towards transitioning to using MySQL C API due to bugs in mysqlpp)
  • Added/implemented LSTM / AI eval mode, showing great initial success at distinguishing between cheating and non-cheating both with keyboard and mouse
  • Zanera SQL data has been inserted into database
  • Improved macro framework a lot
  • We gathered the 25k lines of data of cheating, trained the network using Google Colab, and as mentioned above implemented AI eval mode

Wish I could show some screenshots, but since imgur not working it will have to wait until next time (even if screenshots worked, I don't wanna do it half-ass, I want the gifs too)

I'll share the SQL queries used for login for good measure:
1. To check if account and password is valid: SELECT 1 FROM accounts WHERE uid = %0 AND password = %1q
2. To select characters for character list: SELECT characters.name, worlds.name, worlds.ip, worlds.port FROM characters INNER JOIN accounts ON characters.account_id = accounts.uid INNER JOIN worlds ON worlds.uid = characters.world_id WHERE accounts.uid = %0"
(I know I should add LIMIT to the first one at least, but eh, I'll try to remember for later)

Until next time guys, take care!
 
Time for another short update everyone!

For the last 2 weeks I've almost only worked on my AAC TaoAAC.
So far I've implemented:
  • Pretty URLs automatic detection and adaption including basic PHP routing to basic MVC-like system (currently only Controllers)
  • Account registration
  • Account login
  • Character creation
  • Character deletion
  • Working on cooldown system to reduce effect of small (D)DoS on website
  • I switched from sha256 to bcrypt back to sha256 again
  • We can now login with account/char we've created (but the char will be a Gamemaster character by default like before, this will be changed in the future)
  • Implemented variable byte SALT for SHA256 password hashing

Some of these are some of the hardest parts of the AAC to implement, most other things will be simple by comparison.

Future additions to TaoAAC will be:
  • Templating system
  • Highscores
  • Char search
  • News
  • Analytics
  • Guilds
  • Ban system

Estimate now for Alpha launch: probably winter 2025, but maybe autumn or late summer.

That's all folks, thanks as always for reading. Have a good one!

how do you do to reproduce or replicate cipsoft code?
Most people use reverse engineering tools.
I just copy the formulas others have released publicly here on OTLand and wing the rest using logic and running my own local copy of Realots.
But I don't claim to have perfect everything, there is much work to do, I've just done some basics:
  • Monster spell formulas are 100% accurate because I use the original files
  • Monster spell timings (how often they cast spells) should be 100% accurate except for double spell bug which is only partially accurate
  • Monster drop rate is 100% accurate because I use the original files
  • Player files uses the USR format
  • Monster double spell bug artificially implemented
  • Some other basic mechanics, they're not accurate at all, just basic behavior
 
Hey guys. Been taking a break, working a bit on TaoEngine, a bit on my AI agent, a bit on different projects.

Most recent develops are:
  • Working on full (fake) Tibia 3D
  • Started working on creating Cipsoft replacement sprites using AI (automatized)

Here's a screenshot of the 3D Tibia client for now (work in progress)
mD7sdw9.png


That's all for now, cheers!
 
Hey guys. Been taking a break, working a bit on TaoEngine, a bit on my AI agent, a bit on different projects.

Most recent develops are:
  • Working on full (fake) Tibia 3D
  • Started working on creating Cipsoft replacement sprites using AI (automatized)

Here's a screenshot of the 3D Tibia client for now (work in progress)
mD7sdw9.png


That's all for now, cheers!

Im confused what my eyes see
 
Hey guys. Been taking a break, working a bit on TaoEngine, a bit on my AI agent, a bit on different projects.

Most recent develops are:
  • Working on full (fake) Tibia 3D
  • Started working on creating Cipsoft replacement sprites using AI (automatized)

Here's a screenshot of the 3D Tibia client for now (work in progress)
mD7sdw9.png


That's all for now, cheers!
whats happened with the main proyect of this thread?
 
whats happened with the main proyect of this thread?
This is TaoEngine (the project I just mentioned working a bit on). TypeScriptFTW was a temporary meme name, the engine isn't written in TypeScript.
So I've been working a bit on it, and TaoAAC, but mostly taking a break from them.

Actually I just recalled now partially why I did it, part of it was that I'm about to fully implement the AI cheat detection server (LSTM) which is part of TaoEngine which will automatically flag (and ban) users that are flagged for macro behavior or automatically banned with logs if they send invalid or no data at all (unless the server is down).
And before I do that I thought I have to complete some other things like my 3D client which I just started on, but actually I can, as I just said, just implement it so that if the AI server is down there's no ban.

So I might start working on TaoEngine/TaoAAC again in the near future again if I feel like it, I've had a considerable large break now anyways working on other projects.

Edit:
I can mention a bit what I worked on in the past month. Well, other than relaxing, which every person needs, don't you all think...?
  • I trained my first SLM trying to train the network to categorize various traits based on the contents of messages, for example whether they are hostile. This is part of my introduction to a three letter security agency, bahahaha, no I kid of course, if it was I couldn't even joke about it. It was just for fun and to explore the territory. In the future I want to also try to train the SLM to try to replicate how other people talk and how to respond based on discord chat data. This is necessary for me to learn at some point if I want a realistic AI model that can play the game in the future, to be able to interact with NPCs, to be able to interact with players, and optionally learn spells on its own instead of hardcoding them.
  • I learned some things I won't go into due to the somewhat grey area of ethics (no I don't consider the above one questionable or grey, because people who truly already works on this has already figured this out, but they don't have enough compute probably to run such models globally I'm guessing, and I can't help them). Learning the right architecture and training code took me 2 weeks, so that's already half a month.
  • I've largely improved the architecture of the AI player / agent that plays Open Tibia on its own, but its inputs are still largely random (aka it's not properly learning anything yet), and I think I know why, but implementing a CNN on top of this architecture is still a bit difficult for me, so I'm postponing the task.
  • Fixed some crucial bugs (minor changes, but grave consequences) in AI server and TaoEngine in relation to exception handling code
  • Started working on 3D client as mentioned. I won't go into the details of this one, but to me it's promising.
  • The rest I've been taking a break, learning more philosophy, meditating more, having more fun, cleaning, preparing to moving back home (where I now live), solving RL issues, improving my health, and recently continued my doomsday prepping, hahahaha. Nothing will stop me from continuing to work on Open Tibia (hopefully), hahaha, your EMPs or destruction of the power grid can't stop me foo!

But yeah, back on topic, I will probably continue to work on TaoEngine (TSF) again soon. It needs some love as well.
 
Last edited:
This is necessary for me to learn at some point if I want a realistic AI model that can play the game in the future

AI player / agent that plays Open Tibia on its own, but its inputs are still largely random (aka it's not properly learning anything yet)

implementing a CNN on top of this architecture is still a bit difficult for me

Have you seen pufferlib? It claims to be the state of the art for Reinforcement Learning.
As far as I understood, someone would need to create the (OT) Enviroment and then it would be easy to integrate it with one of those RL libs.

A python headless client such as the one you are creating would be the perfect candidate for that. The alternative, which is not so good, would be to create an enviroment that deals with the UI via image processing.

Another thing that I've been thinking is: The bots this game has had has shown that it is not so difficult to make a computer play the game. Tibia is mechanics are very predictable.

Maybe this AI you are creating would have a better kick off if it focused on one thing at a time. For example, moving the player to the best position it could be based on mobs and other players on screen. A second revision could add the part that handles attacking and keeping itself alive by proper healing. I think it is possible to choose that by changing the reward function in those RL libs.

Those two are the most obvious ones and if there is a straightforward way of modeling them the way the "gymnasium env" expect, all other goals that are not so direct would come naturally. What I would like to see the machine learn is how it would change equips based on different mobs, different hunting strategies based on its levels vs which mobs there are, spells rotations. All that changes on each version.

Also, it would be fun to open a war server with a few of those dumb bots and let them learn with the players.
Maybe they would become invincible in a few days.

I'd like to join you in this if you are interested.
 
Have you seen pufferlib? It claims to be the state of the art for Reinforcement Learning.
As far as I understood, someone would need to create the (OT) Enviroment and then it would be easy to integrate it with one of those RL libs.

A python headless client such as the one you are creating would be the perfect candidate for that. The alternative, which is not so good, would be to create an enviroment that deals with the UI via image processing.

Another thing that I've been thinking is: The bots this game has had has shown that it is not so difficult to make a computer play the game. Tibia is mechanics are very predictable.

Maybe this AI you are creating would have a better kick off if it focused on one thing at a time. For example, moving the player to the best position it could be based on mobs and other players on screen. A second revision could add the part that handles attacking and keeping itself alive by proper healing. I think it is possible to choose that by changing the reward function in those RL libs.

Those two are the most obvious ones and if there is a straightforward way of modeling them the way the "gymnasium env" expect, all other goals that are not so direct would come naturally. What I would like to see the machine learn is how it would change equips based on different mobs, different hunting strategies based on its levels vs which mobs there are, spells rotations. All that changes on each version.

Also, it would be fun to open a war server with a few of those dumb bots and let them learn with the players.
Maybe they would become invincible in a few days.

I'd like to join you in this if you are interested.
Yeah, I'd love to talk to you, whether just for fun or for collaborating.
I cannot send the source code in full (the code will be silo'd), because I promised the OT community not to release this + lots of work + using my own libraries that I use for TaoEngine (security risk), etc.
Because, while training may be costly, the eval of these models would probably be quite cheap, meaning that both hivemind and bot farms would be possible to create with this (easily - I used it to login to my server and dance with 2000+ players earlier), which would not be ethical for me to release, it would have potential damaging effects to an already damaged OT ecosystem.

To answer some specifics:
  • I haven't seen pufferlib before
  • The issue right now is that the massive amount of data, because we need to send map data, requires spatial awareness, requiring a CNN I believe. I got this recommendation (in various forms) both from Unicorns and Claude - this means that even something as trivial as walking is near-random.

I have also thought of things like using cam recordings maybe to teach the network. But yeah.

I think we can discuss the details more in private if you're open for it. My discord is Source1987.
 
because we need to send map data
I think that would be a huge mistake. The AI should be able to explore any map by its own, tbh I would just generate "random" maps or use existing free ones to train some kind of exploring behaviour.
 
Back
Top