• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

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.
 
Late reply, I apologize for it.

Yeah, I'd love to talk to you, whether just for fun or for collaborating.
Perfect, I will contact you then!
I cannot send the source code in full
No problem at all, I am only interested in how to build such a thing.

it would have potential damaging effects to an already damaged
It will happen in the future anyway, at least let's be one of the "pioneers".

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
This is where I believe we can do better. The game is very mechanic. There is no need to train it with the whole map, we can come up with the "scenarios" we normaly encounter. It can be directed where it has to go, a position x,y,z, then if it encounters these scenarios it will know how to act. Think of a self-driving car. It has GPS, so it knows how to go somewhere. But it does not know what it will find during the drive. It knows how to act when that scenario appears. The random walk is good when we want to "discover" the map. After that the map will not change (for that server at least).

Of course that the above is just one of the strategies we could test.

There are several spin-offs that this kind of AI can generate:
  • smarter monster ai
  • war servers vs bots (the ai could have different levels of expertise)
  • party hunts (good if you have no friends)
 
Hey everyone.

Nothing super exciting to report on this time, but I have worked on TaoEngine this whole month, major fixes:
  • Fixed memory leak (4GB+ to 1.5GB with players/1GB without players of memory used)
  • Lots of bug fixes
  • Internal world changes (seemingly necessary) such as using index vs stackpos
  • Other internal changes and additions (like networkhandle::getPos and ::addPos)

I also learned when and when not to use const& and how to do this properly in the future.

Currently I'm working on a crucial long-existing bug: moving things in and out of stacks with more than 10 objects.

Hopefully I'll have this fixed within the next 2 weeks/month, among other things of course.



Just for completeness here's all the changes:
  • Fixed MySQL connection lost error
  • Added lstmServer config
  • Seemingly fixed memory leak (4GB+ to 1.5GB of memory)
  • Fixed (temporary hack) std::stoi exception in NPC parse message
  • Fixed time (%T) in NPC parse message
  • Fixed some monsters "speeding" when randWalking
  • Fixed IP not set issue
  • Fixed "entering infinite loop easily" when many monsters around -> have possibly created a new segfault bug, but we'll try to figure that out later :d
  • Some formatting (removed auto statements and such)
  • Fixed compile script not returning error code on error
  • All player stackpos inputs are limited to 10
  • Added deleteItem stackpos stuff (fire field)
  • Added a bunch of world functions: translateIndex, indexToStackpos, stackposToIndex
  • Fixed a bunch of world functions
  • Fixed monster loot and pushing items out of containers (temporary, needs cleaning up later)
  • Fixed worldtile::internalGetObjectIndex
  • Fixed world::setItem() - depot
  • Added world::getTopObject - fixed MoveTopRel as a result
  • Fixed push items (checkMoveUse) bug + logic
  • Added gameGetPlayers(Position pos, ...)
  • Fixed some stackpos stuff (not all)
  • Hopefully fixed/improved internalGetObjectIndex(...)?
  • Fixed decrementItem (may need to separate deleteItemByIndex and ByStackpos)
  • ... Working on fixing gameCreatureMove stuff (should in theory work, but doesn't)
  • Added networkhandle::getPosition() and ::addPosition()
  • Added worlditem:: and Position::datastr()
  • Added joinItems()
  • Added onUseWith Weapon -> Destroy (prototype, dunno what probability is etc)
  • Moved declarations to modules
  • Better sendMoveCreature(?), but still bugged

Take take everyone and enjoy the rest of the summer!
 
Hey again everyone.

A couple of treats for you this time:
  • Spent the last 10 days heavily reworking the internals of TaoEngine for the better (like 10 separate commits where the engine won't compile because of heavy reworking - but after these 10 commits it works again obviously)
  • Implemented my own custom thread pool that now does multithreaded player loading as well as XTEA encryption, currently working on also making it do XTEA decryption as well as RSA decryption
  • Implemented flushing of networkhandles only once every 1/gamefrequency seconds (no longer sends data immediately, but waits up to 20ms until flushing - not only to reduce the number of packets sent (which is expensive), but also to be able to run XTEA encryption and decryption in parallel)
  • Implemented a "game.cpp" equivalent called "process.cpp" because game.cpp was already used that handles functions with Position arguments that may refer to player's containers/inventories or a worldtile.
  • Implemented "Special/Meaning" items from objects.srv which will be used later to replace hard-coded itemids with Meaning ids instead (superior system to TFS)
  • Implemented creature "logout queue" where creatures including players only dies/logs out every second rather than immediately
  • Config parameter for gamefrequency value
  • New function in(A, B) which checks if T A is in vector[T] B, makes checking for many values in IF conditions much simpler/more consize and readable: if (in(A, {13, 8, 5, 3, 2, 1})) { ... }
  • Implementing onTalk in C++ (we lost all GM commands for now, some will be reimplemented in C++)
  • Started implementing cppGameLoop() in C++, moving more code away from scripting into C++

Multithreading demo (when thread id > 0 it means another thread is doing the encryption)

The game server runs into an infinite loop at the end of this video, this bug has since (yesterday) been fixed, but there is still some other problems that I need to work out in the coming days, like why decryption

That's all for now, cheers!
 
Good news everyone!

Biggest update yet today on the day before the usual bi-weekly update:
  • Lots of boring stuff, lets get to the interesting stuff;
  • Implemented multithreading of XTEA, RSA and SQL handling without any overhead.
  • Implemented a lot of stuff into C++;
  • Server is now 100% C++ except for the config file (on the downside: this means, while the server compiles, runs and boots, it does not have map loading etc yet, because a few more functions needs to be translated into C++)
  • Implemented CMake system for multithreading compilation (44 -> 15s on -O1, 17s on -O3, if just a single or a few files has been touched: ~5-7s recompilation including linking)
  • Implemented multithreading connection pooling, on 16 cores this increases packet throughput from 30k/s to 600k/s (or from 30µs overhead to 2µs overhead per packet)
  • Additionally this means the server now has basically everything possible running multithreaded (on separate CPU cores)
  • Implemented long-missing "boot error message" when trying to connect while server is still booting.
  • More config options: newConnLimitPerSec and estConnLimitPerRound. These default to 0 (infinite/no limits) by default if you remove them from config (or set to 0 yourself, which is preferred).
  • Also implemented much faster "worldexpiretimes" using a std::set instead and using absolute timestamps instead of relative seconds left.
  • Monster definitions are also in C++, we just need to parse the files.
  • Items and other things are also parsed in C++, but I sort of loosely mentioned this as "C++ is 100% now" etc, many big and advanced functions implemented and working in C++.

These last config values are there to avoid the game server from lagging, ensuring that each game round does not spend too much time per gameLoop.
This means if these are set that other connections will be ignored for 1 gameround (by default equal to 1/50th of a second or 20ms) until the next round.

I wanted to post a bunch of screenshots, but again imgur is being ass.
They've banned my VPN provider for many months, and it also no longer works with Tor.

So my options are either upload to youtube, find a different image provider, or don't post screenshots.
For now I choose no screenshots since I gotta go in 8 minutes anyway, but you can find some screenshots on the unofficial OTLand discord etc if you'd like to see them.

I don't honestly have an expected time for launch considering these advanced developments and still having many bugs and missing features.
But I'm still hoping for a testserver/alpha launch before the end of 2025 :)

Anyway, that's all for now since I really gotta go now, cheers everyone!
 
Hey everyone. After getting thousands of views on reddit in less than 24 hours I decided to relaunch my blog @ Source's Tiny Technology Blog (http://taoengine.net).
You can find screenshots from the latest update there & rolling progress (likely more frequent than bi-weekly updates over there).

If you'd like to see recordings or screenshots of previous updates or something let me know.

Now that map loading, monster loading, spawn loading, spawning, and baseline CPU performance has been improved, together with multithreading of the entire server and most recent bugs has been fixed, the next goal is fixing some potentially hard old bugs & add NPC parsing back, which will be hard, but rewarding and interesting, then adding monster and player spellcasting back (monster spells are parsed, but not actually casted), that's the plan for now.
 
Hello again guys.

Another good news update, starting with the biggest news as usual:
  • I've implemented multithreaded pathfinding and "changeTarget" (which is using getCreatures and is expensive too)
  • We added player height and player width, monster height and monster width in config and a packet is send to OTC to update player width/height on login (demo with more tiles below this list of updates)
  • Added map loading, monster loading with monster spells, spawn loading and others back, lots of optimizations and improvements, one of them being that players now has a tile pointer to the tile they're standing on for example ;-)
  • We added Items Expiration back (much more optimized now, took about 12h to make it work) with config options expireRateItems and expireRateGrounds with all values above 0 that doesn't overflow being accepted; 1/100, 100, you mention it
  • Fixed parsing Outfit changes (including Outfit spells; invisibility for monsters also works)
  • Partially implemented Meaning now with item::getMeaning() which is used to parse things like Fire, Poison and Energy elements on map load INSTEAD of using itemids
  • Many bug fixes as well

Here's a demo of the performance of the new multithreaded pathfinding/everything with hundreds of monsters trying to attack our summon (1-2% of the main thread is used, in total it's 5%+ for all threads):

You can read more about this change, other changes, the full background of TaoEngine, my About Me section, and a full overview of the main TaoEngine features at Source's Tiny Technology Blog (http://taoengine.net/)

The server also only uses about +1% of CPU if you map click far away at full running speed (about 100 tiles/s) now, this means we can, without much penalty, allow players to run faster; assuming all 100 players runs at FULL speed, which you will need something like level 30'000 to achieve, the maximum number of players you can have on that server is only 100, but it's an insanely unlikely scenario.

Usually many players are AFK, and usually most if any players are not level 30'000.
There are other issues with high levels, being things like max EXP will be troublesome, internally player I believe has a uint64_t experience datatype, meaning it can probably store EXP all the way up to level 30'000 or more, but the 7.70 protocol sends EXP as only an unsigned int I believe.

Anyway, enough rambling for today, that's all for now.

Cheers & enjoy the rest of Autumn guys! :D
 
Hello everyone.

Just an average update today, been focusing mostly on bug fixes and various other things.

(Barely) noteworthy changes:
  • Improved/simplified onPositionChange dramatically
  • Fixed PosFromString (e.g. "[123,456,789"] into a Position object)
  • Fixed all basic summon behaviors and moved their pathfinding to multithreading with the rest of other monsters
  • One of my commits says "lots of important stuff" - couldn't be bothered naming them and forgot what they were now, haha
  • Players now use the Human "monster" for many key variables including outfit colors and "skills" upon creation
  • Yes, we can create players in rook now, finally (it's a little bugged, some skills are off and no items yet, but the main work is done)
  • We also load players on demand now, not on boot (unless the account has been logged into in the last 30 days), this drastically improves boot times too
  • Switched from counting_semaphores (bugged in C++20+) to mutexes
  • Disconnect from game without logging out -> reconnect now works (this is a bug that still exists in Realots/old Real Tibia, your client will say "Connecting" forever because the socket is never closed, maybe unless the socket disconnects? I don't know about Realots RE to say)

And then, as a result of yesterday reinventing a mass-login script for my server in a few hours, I've fixed and am working on the following things:
  • Fixed epoll race conditions
  • Better use of locks (still not perfect, there's still some race conditions under exceptional circumstances where thousands of players connect and disconnect continuously)
  • We tested performance with 1000 players not doing anything: 4% CPU usage of main thread (monsters are active, but all players are GMs, so the monsters doesn't do any pathfinding, attacks or target spells)
  • I'm considering whether we should emulate Real Tibia by handling only new connections once a second, or every turn, because right now it can only take in approximately 70 new players per second with 16 CPU cores
  • Currently working on fixing all segfaults and memory corruption from race conditions
  • I'm also working on getting "connect to already online player -> disconnect socket -> login on new socket while keeping the player online the entire time" to work. There's an unknown problem with this that I don't fully understand yet

That's all for now, stay tuned for more updates and have a good one!
 
Back
Top