• 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,716
Solutions
12
Reaction score
1,003
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
 
Back
Top