• 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!

BlackTek-Server Development Thread

Codinablack

Dreamer
Content Editor
Joined
Dec 26, 2013
Messages
1,734
Solutions
12
Reaction score
1,020
Ok guys, figured I should probably stop using the other threads to discuss development of black tek, as per otland rules. The pre-release thread, and the other discussion thread about "Does anyone want an updated 1.4x" were both not threads specifically created for the purpose of discussing the development of BlackTek.

So here is where you can find and discuss on topics such as features, bugs and releases, or any other cool ideas you guys might have for black tek.

@Roddet If you don't mind, both those other two threads can be closed now. It will help to make sure all traffic on the discussion of BlackTek goes to the proper location now. Thanks! I appreciate it!

So everyone is up to date.

Recently I added a new event interface called "Item Events" , try not to be to comfortable with those events just yet, as I will be condensing the 5 of them down into 2, to reduce the amount of events firing off per combat.

Imbuements bugs have all been worked out, and we have some lua scripts being developed for Black-Tek that uses the imbuement api to create a copy of the system that CIPIA uses. This system has been being developed for everyone by @ohman . So big thanks to him for spending his time to help contribute, as I am sure many users would like to see the same system. One or two caveats have to be made ofc, as 10.98 doesn't contain all the same items as 13.x clients, nor does it contain a shrine, but there is an appopriate creature item being used as a suitable substitute. This is a very elaborate system that takes lots of time to match all the ins and outs of, and to also test thoroughly. So again, big thanks to ohman for putting in the time and getting the ball rolling on that for us.

The switch from "Conan" to "Vcpkg" was to try to make it easier for you all to be able to generate the files needed to build BlackTek Server. It has had a few hiccups, ran into a few unexpected issues, but thanks to the help of @Gesior.pl we now have it working properly on 64 bit systems running Linux. Ofc, it hasn't been tested on every possible platform, under every possible scenario, so if you guys run into any issues, please don't hesitate to post them here, on the github, or if you already have me on discord, you can message me as well. If you want, you can raise the issue all three places, as to make sure I see it!

Future plans.

I will of course continue on adopting code fixes that TFS finds, and implements, that could also apply to Black Tek.

I will eventually replace all raw (or atleast most of them) pointers with smart pointers, to eliminate unexpected crashes and memory leaks.

I will be adding a webhook api eventually, to use for stuff like github, discord, private webservers, forums, ect.

I will be rewriting the current "Item abilities" to a specific and robust sytem built around "Damage Modifiers", which will include things like, absorb, reflect, deflect, resistance, ect.

I will be adding an "Ingame Account Manager" system, to make it even easier to go from nothing to fully working server.

I will add in more options for handling spawning, such as positional (current version) spawning, zone spawning, and relational spawning. In addition to these new spawning systems, I have already created "Black Tek Map Editor", you can find on the Black Tek organization github. It also uses premake and vcpkg to make the process of creating your own builds as easy as possible.

I will add resources (wood, stone, (dust for cipia weapon upgrades), ect), that will go along with the addition of "Crafting". So to be clear, I do plan to add resource gathering and crafting, as a robust lua api for you all, to make it the way you want.

Long term, I do plan to bring in "TOML" support, and phase out the usage of "XML" alltogether in favor of TOML.
There are also many other long term goals, and things on my todo list, I didn't want to cover everything, but I figured I would give you guys some idea's on what to expect in the near and far future.

TLDR

Black Tek is now easier to generate builds, more bug free than it has ever been, and is chalk full of exciting new features, as well as many new features planned.
 
Last edited:
Update:

I reworked the Attack/Defend events for both creatures and items. Since event callbacks need to have unique names, I couldn't just use "onAttack" and "onDefend" as the event name for both creatures and items... I didn't realize this until I got to the end and was adding in the lua parts, so I settled with renaming the creature events to "onDoAttack" and "onDefendAttack", item events are named "onAttack" and "onDefend.

A small breakdown of the parameters provided.

Creature Event Callbacks
onDoAttack(self, target, blockType, combatType, origin, criticalDamage, leechedDamage)
onDefendAttack(self, attacker, blockType, combatType, origin, criticalDamage, leechedDamage)

Item Event Callbacks
onAttack(self, attacker, target, blockType, combatType, origin, criticalDamage, leechedDamage)
onDefend(self, defender, attacker, blockType, combatType, origin, criticalDamage, leechedDamage)

As always, the first parameter on any callback is the userdata its being called on. So for creatures, "self" will be a creature, and for the items, "self" will be an item.

For onDoAttack, the "target" is the one recieving the attack, and for onDefendAttack, the "attacker" is the one doing the attack.

blockType is a valid enum value for "BlockType_t", so things like "BLOCK_DEFENSE", "BLOCK_ARMOR", ect will be what is sent here.

combatType is a valid enum value for "CombatType_t" so things like "COMBAT_PHYSICALDAMAGE" , "COMBAT_LIFEDRAIN", ect will be sent here.

origin is a valid enum value for "CombatOrigin" so things like "ORIGIN_SPELL", "ORIGIN_MELEE", ect, will be sent for this parameter.

criticalDamage and leechedDamage are both boolean values. That means they will be either "true" or "false. They are there to indicate if the damage called on this instance is from being "critical damage" or if its is a type of leeched damage, such as "lifeleech" and "manaleech".

I also laid the foundations for dodge in creatures. There is currently a "blockType" called "BLOCK_MISS" that will later on used for when a target dodges an attack. I also added "dodgeChance" to creatures, and methods to increase, decrease, get and set it. I just haven't implemented the logic for dodge/miss yet.

Try to remember to use these events responsibly, since we don't require registering them to a creature/item, they fire on all creatures/items when they are enabled. So best practices is to check immediately if you want to execute logic for this creature/item, if not , return. Early returns, and returning as soon as possible will be a key factor in not letting these events bog your server down.

Bear in mind that during a single combat action, if you have all these events enabled, everyone of them will fire... and, the item events will fire as many times as you have items contributing to the attack or defense in that situation.

Otherwise, Enjoy :D
 
I'm not trying to sound disrespectful so if it comes off as that I apoligize beforehand.

I'm very new to all stuff OT related so my questions might sound dumb to some but we all start from somewhere right?

What exactly is BlackTek? is it a substitute for TFS? if yes, what are you offering over TFS and why should one go with BlackTek instead?

If someone like me, who is in the starting blocks about to set out creating what they can, learning how to read code, how to script, map and everything inbetween, would BlackTek be a good place to start or will I be limited by it, what could I expect from BlackTek?

I'm impressed seeing so many extraordinary minds creating so many incredible things here on otland it just makes me want to learn more and be able to contribute! Keep your good work up and know that you inspire others to do stuff as well!
 
I'm not trying to sound disrespectful so if it comes off as that I apoligize beforehand.

I'm very new to all stuff OT related so my questions might sound dumb to some but we all start from somewhere right?

What exactly is BlackTek? is it a substitute for TFS? if yes, what are you offering over TFS and why should one go with BlackTek instead?

If someone like me, who is in the starting blocks about to set out creating what they can, learning how to read code, how to script, map and everything inbetween, would BlackTek be a good place to start or will I be limited by it, what could I expect from BlackTek?

I'm impressed seeing so many extraordinary minds creating so many incredible things here on otland it just makes me want to learn more and be able to contribute! Keep your good work up and know that you inspire others to do stuff as well!

You don't come off disrespectful at all!

BlackTek is a starter project for me to learn on, and give back to the community, while simultaneously transforming it into a custom game engine software stack. Since I started with what was widely regarded as the most "stable" version of TFS, I decided that others who were doing the same might appreciate the changses I am making. So far, most of the changes were strictly bug fixes or missing features from TFS 1.6... there are however my own changes I have made, and are going to continue to make. The first release's goal will be to provide everyone with a more up-to-date 10.98 server, based on 1.4.2 and backwards compatible with 1.4.2. After that, the goal will change towards being a server that has more built-in features, modernized code (as much as I can) and able to handle a massive player load.

What does it currently offer vs TFS of same client version?

-Bug fixes, and missing features from 1.6. (See commits on the github, # tags in early commits reference the PR# the code was taken from TFS)
-Lua Based Build System
-Uses current libraries
-C++20 target language
-Imbuements
-Item Classifications
-Item Tiers
-Item Event Interface, with brand new ItemEvents
-Personally chosen & personally made optimizations
-Future Development Plans

As far as Future Development Plans goes, there is no other server out there that is offering continued development and support for using the 10.98 client. TFS has moved on, OTX has moved on, OTServBR has moved on... No-one else offers 10.98 exclusively. 10.98 will stay the target client version of BlackTek.

Try to keep in mind, Black Tek Server is still fairly new and its only myself working on it.
1718512663127.png
 
Last edited:
You don't come off disrespectful at all!

BlackTek is a starter project for me to learn on, and give back to the community, while simultaneously transforming it into a custom game engine software stack. Since I started with what was widely regarded as the most "stable" version of TFS, I decided that others who were doing the same might appreciate the changses I am making. So far, most of the changes were strictly bug fixes or missing features from TFS 1.6... there are however my own changes I have made, and are going to continue to make. The first release's goal will be to provide everyone with a more up-to-date 10.98 server, based on 1.4.2 and backwards compatible with 1.4.2. After that, the goal will change towards being a server that has more built-in features, modernized code (as much as I can) and able to handle a massive player load.

What does it currently offer vs TFS of same client version?

-Bug fixes, and missing features from 1.6. (See commits on the github, # tags in early commits reference the PR# the code was taken from TFS)
-Lua Based Build System
-Uses current libraries
-C++20 target language
-Imbuements
-Item Classifications
-Item Tiers
-Item Event Interface, with brand new ItemEvents
-Personally chosen & personally made optimizations
-Future Development Plans

As far as Future Development Plans goes, there is no other server out there that is offering continued development and support for using the 10.98 client. TFS has moved on, OTX has moved on, OTServBR has moved on... No-one else offers 10.98 exclusively. 10.98 will stay the target client version of BlackTek.

Try to keep in mind, Black Tek Server is still fairly new and its only myself working on it.
View attachment 85527
Ok, that sounds awesome actually! I will make sure to keep an eye out to see how it goes, maybe one day I'm good enough at coding and such to help out in some way haha :)

Good luck!
 
TLDR

Black Tek is now easier to generate builds, more bug free than it has ever been, and is chalk full of exciting new features, as well as many new features planned.
Those are great news, the community could use this fresh blood and energy. I'm sorry, but I didn't happen to notice if you're willing to make the project open source. Perhaps, when I'm comfortable enough with C++, I could contribute (assuming it's open source).
Keep posting your progress. Looking forward to see what's coming next.
 
Those are great news, the community could use this fresh blood and energy. I'm sorry, but I didn't happen to notice if you're willing to make the project open source. Perhaps, when I'm comfortable enough with C++, I could contribute (assuming it's open source).
Keep posting your progress. Looking forward to see what's coming next.
Black Tek is absolutely open source.

 
how i can solve it ?
Code:
root@vmi1969669:/usr/src/bts# premake5 gmake2 && make -j $(nproc) config=debug_64
Building configurations...
Running action 'gmake2'...
Generated projectfiles/Black-Tek-Server.make...
Done (431ms).
make: *** No targets specified and no makefile found.  Stop.
root@vmi1969669:/usr/src/bts#
1719592598514.png
 
how i can solve it ?
Code:
root@vmi1969669:/usr/src/bts# premake5 gmake2 && make -j $(nproc) config=debug_64
Building configurations...
Running action 'gmake2'...
Generated projectfiles/Black-Tek-Server.make...
Done (431ms).
make: *** No targets specified and no makefile found.  Stop.
root@vmi1969669:/usr/src/bts#
View attachment 85731
I am unsure man. Can you give me a bit more information.... I need to know what OS you are using... and if you could, send the make file so I can examine it, then maybe I can help with troubleshooting.
 
I am unsure man. Can you give me a bit more information.... I need to know what OS you are using... and if you could, send the make file so I can examine it, then maybe I can help with troubleshooting.
Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-105-generic x86_64)

I think it's here, since the folder isn't called Black-Tek-Server

this line on black-tek-server.make
Code:
TARGET = $(TARGETDIR)/Black-Tek-Server
How can I change this?

Code:
# Alternative GNU Make project makefile autogenerated by Premake

ifndef config
  config=debug_64
endif

ifndef verbose
  SILENT = @
endif

.PHONY: clean prebuild

SHELLTYPE := posix
ifeq ($(shell echo "test"), "test")
    SHELLTYPE := msdos
endif

# Configurations
# #############################################

RESCOMP = windres
TARGETDIR = .
TARGET = $(TARGETDIR)/Black-Tek-Server
FORCE_INCLUDE +=
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef

ifeq ($(config),debug_64)
OBJDIR = ../build/Debug/obj/64
DEFINES += -DDEBUG
INCLUDES +=
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -Og -g -mavx -Wall -Wextra -pedantic -pipe -fvisibility=hidden -Wno-unused-local-typedefs -fno-strict-aliasing -std=c++20
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -Og -g -mavx -std=c++20 -Wall -Wextra -pedantic -pipe -fvisibility=hidden -Wno-unused-local-typedefs -fno-strict-aliasing -std=c++20
LIBS +=
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto

else ifeq ($(config),debug_32)
OBJDIR = ../build/Debug/obj/32
DEFINES += -DDEBUG
INCLUDES +=
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -flto -Og -g -mavx -Wall -Wextra -pedantic -pipe -fvisibility=hidden -Wno-unused-local-typedefs -fno-strict-aliasing -std=c++20
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -flto -Og -g -mavx -std=c++20 -Wall -Wextra -pedantic -pipe -fvisibility=hidden -Wno-unused-local-typedefs -fno-strict-aliasing -std=c++20
LIBS +=
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -flto

# Rules
# #############################################

all: $(TARGET)
    @:

$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR)
    $(PRELINKCMDS)
    @echo Linking Black-Tek-Server
    $(SILENT) $(LINKCMD)
    $(POSTBUILDCMDS)

$(TARGETDIR):
    @echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
    $(SILENT) mkdir -p $(TARGETDIR)
else
    $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif

$(OBJDIR):
    @echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
    $(SILENT) mkdir -p $(OBJDIR)
else
    $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif

clean:
    @echo Cleaning Black-Tek-Server
ifeq (posix,$(SHELLTYPE))
    $(SILENT) rm -f  $(TARGET)
    $(SILENT) rm -rf $(GENERATED)
    $(SILENT) rm -rf $(OBJDIR)
else
    $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
    $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED))
    $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif

prebuild: | $(OBJDIR)
    $(PREBUILDCMDS)

ifneq (,$(PCH))
$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER)
$(GCH): $(PCH) | prebuild
    @echo $(notdir $<)
    $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
    $(SILENT) touch "$@"
else
    $(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | prebuild
endif

Code:
# Alternative GNU Make workspace makefile autogenerated by Premake

ifndef config
  config=debug_64
endif

ifndef verbose
  SILENT = @
endif

ifeq ($(config),debug_64)
  Black_Tek_Server_config = debug_64

else ifeq ($(config),debug_32)
  Black_Tek_Server_config = debug_32

else ifeq ($(config),release_64)
  Black_Tek_Server_config = release_64

else ifeq ($(config),release_32)
  Black_Tek_Server_config = release_32

else
  $(error "invalid configuration $(config)")
endif

PROJECTS := Black-Tek-Server

.PHONY: all clean help $(PROJECTS)

all: $(PROJECTS)

Black-Tek-Server:
ifneq (,$(Black_Tek_Server_config))
    @echo "==== Building Black-Tek-Server ($(Black_Tek_Server_config)) ===="
    @${MAKE} --no-print-directory -C . -f Black-Tek-Server.make config=$(Black_Tek_Server_config)
endif

clean:
    @${MAKE} --no-print-directory -C . -f Black-Tek-Server.make clean

help:
    @echo "Usage: make [config=name] [target]"
    @echo ""
    @echo "CONFIGURATIONS:"
    @echo "  debug_64"
    @echo "  debug_32"
    @echo "  release_64"
    @echo "  release_32"
    @echo ""
    @echo "TARGETS:"
    @echo "   all (default)"
    @echo "   clean"
    @echo "   Black-Tek-Server"
    @echo ""
    @echo "For more information, see https://github.com/premake/premake-core/wiki"
 
@_M4G0_
I ran docker using Ubuntu 22.04 and Ubuntu 20.04 and both showed:
Code:
premake5 gmake2 && make -j $(nproc) config=debug_64
Building configurations...
Running action 'gmake2'...
Generated Makefile...
Generated Black-Tek-Server.make...
Done (114ms).
IDK why your premake5 generates file in some folder projectfiles/Black-Tek-Server.make.
How did you install premake5?
Code:
apt install -y unzip make g++ uuid-dev wget && \
    mkdir /bts && \
    cd /bts/ && wget https://github.com/premake/premake-core/archive/refs/heads/master.zip && \
    cd /bts/ && unzip master.zip && rm master.zip && \
    cd /bts/premake-core-master && make -f Bootstrap.mak linux && \
    mv /bts/premake-core-master/bin/release/premake5 /bin/premake5 && \
    rm -rf /bts/premake-core-master/bin/release/premake5
Anyway, on Ubuntu 20.04 compilation fails, because g++ is too old and does not work with -std=c++20 ( g++: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++2a'?).
 
@_M4G0_
I ran docker using Ubuntu 22.04 and Ubuntu 20.04 and both showed:
Code:
premake5 gmake2 && make -j $(nproc) config=debug_64
Building configurations...
Running action 'gmake2'...
Generated Makefile...
Generated Black-Tek-Server.make...
Done (114ms).
IDK why your premake5 generates file in some folder projectfiles/Black-Tek-Server.make.
How did you install premake5?
Code:
apt install -y unzip make g++ uuid-dev wget && \
    mkdir /bts && \
    cd /bts/ && wget https://github.com/premake/premake-core/archive/refs/heads/master.zip && \
    cd /bts/ && unzip master.zip && rm master.zip && \
    cd /bts/premake-core-master && make -f Bootstrap.mak linux && \
    mv /bts/premake-core-master/bin/release/premake5 /bin/premake5 && \
    rm -rf /bts/premake-core-master/bin/release/premake5
Anyway, on Ubuntu 20.04 compilation fails, because g++ is too old and does not work with -std=c++20 ( g++: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++2a'?).
followed these instructions

Ubuntu 22.04 solved
thanks @Gesior.pl @Codinablack
 
Last edited:
I do have a work in progress going for scripts that can be downloaded and used to handle the entire install process for each of the major types of linux, as well as scripts that would be included with the repo, that could handle the rest of the setup for builds and such. I will eventually give some more time to this sub-project, and probably included dedicated wiki pages at some point as well.

For now, I am just glad those who want to use it are able to use it!
 
I have a small presentation to celebrate the finishing touches and final fixes being done with the imbuements! I made a working framework for imbuements in the sources for lua, and @ohman took that framework, built upon it, and worked around its limitations to bring you guys the same imbuements system used in tibia, with a few minor concessions, but we can talk about that later.

Everyone give a big thanks to @ohman for all the hard work he put in on replicating cips system for you guys!

Here we have some demonstrations of the imbuements being applied to equipment.


As for the minor concessions, there is some items that dont exist in 10.98, so an appropriately difficult creature product was substituted for the creature products, and a placeholder demonstration item was used for the shrine, you are encouraged to change those things to fit your own preference for your server.

I went ahead and created another convenience release for everyone, with the most up to date sources.

 
Last edited:
Well here we go.

A little of my experience with black tek.
I have now fully stepped over to black tek from tfs.

The compiling of black tek is far superior when compared to tfs. So fast and easy.

I have also had 0 issues with warnings or errors.

I have even managed to get everything working without issues starting from scratch with scripts etc.

I have a fully custom otb , dat and spr and it is working so nicely.

With black tek i am able to really create my own game stepping away from tibia eventually and just moving forward.

Every day i get more done and every day black tek amazes me tbh.
Can not wait to see what else Codinablack has in store for us while i also add my own stuff.

image.png
 
Well here we go.

A little of my experience with black tek.
I have now fully stepped over to black tek from tfs.

The compiling of black tek is far superior when compared to tfs. So fast and easy.

I have also had 0 issues with warnings or errors.

I have even managed to get everything working without issues starting from scratch with scripts etc.

I have a fully custom otb , dat and spr and it is working so nicely.

With black tek i am able to really create my own game stepping away from tibia eventually and just moving forward.

Every day i get more done and every day black tek amazes me tbh.
Can not wait to see what else Codinablack has in store for us while i also add my own stuff.

Its amazing to see how far you have progressed! Changing out all the sprites and starting from scratch is truly impressive!

I am also pleased to hear you have enjoyed the ease of use with the build system, that was a big thing to replace from TFS.

As far as building your own game, keep going strong my friend! I loving the looks of your creation and am eager to try it out one day with the rest of the world!
 
How can i compile to generate gdb log?
 
Back
Top