Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2019-12-17 00:00:00Z and 2019-12-18 00:00:00Z
Avatar
[quakenet] Learath2 BOT 2019-12-17 16:30:42Z
currently every time an entity is marked for destruction CGameWorld::RemoveEntity is called twice, once in RemoveEntites explicitly and once through ~CEntity()
16:31
This isn't a problem when you have a single gameworld, but when working with multiple gameworlds, the gameworld reference is already invalid as soon as the entity is removed from a world, which causes a null pointer dereference
Avatar
[quakenet] Dune BOT 2019-12-17 17:11:44Z
huh, where should it be destructed then?
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:20:55Z
Well either explicitly RemoveEntity, or let the destructor do RemoveEntity. With ddnet I stopped letting entities self-insert/remove to/from worlds so I explicitly insert/remove the entities I create/destroy
Avatar
destructor samantically better
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:21:58Z
letting the destructor do it is a little dangerous when you can override the destructor though
Avatar
and you can't override an yothe rmethod?
17:22
RemoveEntity for example
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:23:22Z
RemoveEntity is a method of the game world
Avatar
overridable?
17:23
it's the same argument that doesn't say anything
17:24
if you can break your leg by walking, you should not walk is what I see here as an argument
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:24:41Z
First of all, it's much more common to inherit from CEntity then CGameWorld
Avatar
semantically a destructor removes an object properly and cleans up afterwards
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:25:07Z
Second, RemoveEntity is indeed not a virtual method, so if you are trying to override it you are obviously doing something wrong
Avatar
well, then keep it as is
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:26:32Z
Third, CGameWorld is a "container" an item of the container affecting it's container is hardly great encapsulation, items don't remove themselves from linked lists
17:27
As is you are calling RemoveEntity twice. If you are okay with that, knock yourselves out, just wanted to point out a problem I encountered during development
Avatar
usually the destructor should be called in reverse order by inheritance(if I'm not off here), thus you don't override it, but overshadow, I guess implementing the entity destruction for every class in the base class CEntity would make sense and not care about inheriting classes
17:28
actually doing anything about the removal from the World class
17:29
short, implement in CEntity destructor and let inheriting classes not care about the removal from the world object
Avatar
[quakenet] Dune BOT 2019-12-17 17:33:17Z
just put that in RemoveEntity and call it a day
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:33:19Z
Which is what is done currently, but you are also calling RemoveEntity from CGameWorld::RemoveEntities, which is the double call I'm talking about...
17:33
If you are letting the entities handle the removal from the world, fine, be consistent about it
Avatar
mind linking the code lines?
Avatar
[quakenet] Dune BOT 2019-12-17 17:36:39Z
grepr removeentitysrc/game/server/gameworld.cpp:85:void CGameWorld::RemoveEntity(CEntity *pEnt)
Avatar
the problem lines
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:37:15Z
gameworld.cpp#157 is the extra call I'm talking about
17:39
But the problem is there is no guarantee that Destroy() will lead to a RemoveEntity() as Destroy is a virtual method. I'd just get rid of destroy and delete the entity there and let the destructor chain handle it
Avatar
I find the Destroy() function rather weird.
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:40:41Z
But then CCharacter doesn't actually destruct itself on Destroy() so that'd break that
17:41
Which is one of the reasons why I took the other approach
17:41
More flexible and in my case allows me to easily move entities between gameworlds
Avatar
nice, so CCharacter inherits the weird Destroy funcrtion and overshadows it with a newly implementation that doesn't contain the code of the inherited destroy function from CEntity
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:45:28Z
Which is intended by the way, characters aren't destroyed, they are set not alive and set alive when spawned
Avatar
calling both functions the same is imo bad
17:48
would prefer if the "delete this" war removed, but might break a lot of stuff
17:48
was*
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:48:59Z
There are a handful of places where Destroy is called, it's not too hard to rework
Avatar
also funny: CCharacter has a reset function, that calls Destroy, then why not use Reset instead of Destroy
17:49
as both do the same
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:49:33Z
also funny: nothing ever should be calling Destroy on a CCharacter anyway
17:49
except itself
Avatar
publicly accessible
17:50
should at leats be protected for inheritance purposes.. ,Destroy is bad imo
17:51
CEntity::Destroy
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:53:26Z
It's the only natural solution if you want to delete entities but also want entities that can't be deleted
Avatar
[quakenet] Dune BOT 2019-12-17 17:53:44Z
I wonder if that will mess up mods that merge without being aware enough of what's going on
17:53
only those with several worlds are affected I imagine
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:54:32Z
Just removing the RemoveEntity on L157 shouldn't change anything, only entity that behaves differently is CCharacter and that is never supposed to be deleted anyway let alone marked for destruction
Avatar
mind elaborate on that, ccharacters cannot be deleted as you said? but rest can?
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:54:58Z
@jxsl3 they can be deleted ofc, they just never are
17:55
Destroy for CCharacter is never called except if CCharacter calls it, so it's pointless anyway
Avatar
why is delete pEnt not a feasible solution on line 158 instead of pEnt->Destroy()?
17:57
delete pEnt;
17:58
hm, character
Avatar
"I could fix it right, or I simply use smartpointer"
Avatar
teeworlds = anti stl 😮
Avatar
[quakenet] Dune BOT 2019-12-17 17:59:10Z
STL = pure garbage*
17:59
  • C++ committee member
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:59:17Z
@jxsl3 A character is never to be marked for destruction as far as I can see
Avatar
(and because dune hates stl)
Avatar
[quakenet] Learath2 BOT 2019-12-17 17:59:58Z
Dune: STL has a couple useful things, smart pointers are pretty nice
Avatar
(and I don't know how bit the commitee is, so I cannot evaluate your value as one person there)
Avatar
[quakenet] Dune BOT 2019-12-17 18:00:07Z
Oh yeah, STL has a lot of useful things
Avatar
[quakenet] Dune BOT 2019-12-17 18:00:20Z
Only the implementation of containers is systematically garbage
18:00
If you don't care about performance, STL is fine. And it's really stable!
Avatar
don't hate on vector, even tho it's naming is garbage 😮
Avatar
smartpointer are the best thing to make bad software at least have less mermory leaks
Avatar
[quakenet] Dune BOT 2019-12-17 18:01:07Z
@jxsl13: the implementation of vector in STL is terrible, because it is decades old, and the standard locks one implementation
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:01:23Z
I never benched it myself but iirc vector can be 0 overhead, no?
Avatar
[quakenet] Dune BOT 2019-12-17 18:01:49Z
even the smallvector of LLVM was benched to give better results on LARGE vectors than the std::vector
18:02
I like the ideas of smart pointers though :) but only where necessary
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:02:18Z
Eh, the standard sticking it's nose into implementation is not good
Avatar
[quakenet] Dune BOT 2019-12-17 18:02:31Z
It's good for only one thing: performance predictability
Avatar
for performance I usually go away from vectors and use either single linked lists or stacks or heaps, trees, stuff
Avatar
I only tested it on tw level and compared to a c array with 64 players it was kinda worse by a factor of 4 ._.
Avatar
[quakenet] Dune BOT 2019-12-17 18:02:55Z
@Assa as long as you use it from a recent library vectors can be fine
Avatar
guess rust is the way to go ._.
Avatar
[quakenet] Dune BOT 2019-12-17 18:03:26Z
just use a c++ lib
18:03
or make your own baselib
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:03:41Z
I'd rather shoot myself then link with boost...
Avatar
[quakenet] Dune BOT 2019-12-17 18:03:52Z
I know :D but there are nice alternatives now
Avatar
what do you use for signals?
Avatar
if you wanna use an external lib for every little shit in c++, what's the worth of c++ then -> 0
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:04:29Z
Oh don't say that, C++ has a nice inheritence system
Avatar
theoretically you could use QT for everything
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:04:38Z
RTTI is not half bad either
Avatar
well, wow xD one of many features
18:05
RAII is nice
18:05
that's about it, then
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:05:49Z
C++ is pretty decent to use without it's STL
Avatar
[quakenet] Dune BOT 2019-12-17 18:06:35Z
@jxsl13 c++ is fine, the implementation of the standard lib enforced by the standards is garbage
Avatar
if you look on java, it's not better: you add an external lib to your pom for everything
Avatar
production cycle is bad, as you'd need to implement everything from scratch yourself
Avatar
[quakenet] Dune BOT 2019-12-17 18:06:50Z
you can write your own naive containers and they will have better performance
Avatar
or search for libs
Avatar
@Dune do you have some links or evidence for the "stl is garbage" statement btw?
Avatar
that might not be supported
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:07:02Z
I kinda nuked the entirety of IGameController to make it into an actual interface
Avatar
tw needs to be refactored from scratch anyway ._.
Avatar
do they have better performance because they can't accept every combination of throwing move/copy/whatever constructors that the STL containers must support?
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:07:49Z
ohi @heinrich5991, mind taking a quick look at my last pr while you are around, promise it'll just be like 5 min tops
Avatar
can't wait for teeworlds 2.0
Avatar
link?
Avatar
you be ded by then, @Assa
18:08
xD
Avatar
www.imaginary-content.com
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:08:27Z
I think we should also store the SHA256 in the demo, but I'm not sure how to upgrade the demo format. I also stored the SHA256 in the demo, but is this the right way to do it? I smell endia...
Avatar
Am I allowed to do my own teeworlds 2.0 with Vulcan, beer and hookers?
Avatar
that looked hard to review 😄
18:09
but okay, I'll take a look
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:09:30Z
@heinrich5991 you already reviewed the thing, I just need an ok for the last commit :P
Avatar
rip vulkan, 2k lines of initialization code
Avatar
i want an easy to use graphics library
18:10
but i probably end with unity then
Avatar
beer and hookers are approved
Avatar
[quakenet] Dune BOT 2019-12-17 18:11:00Z
heinrich5991 looking for one but I'm afraid not, it was a live thing
18:12
cf. chandler carruth
18:12
every small implementation detail of STL containers was put in the standard, so they cannot move anymore
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:12:33Z
Dune: iirc std::vector was 0 overhead if you preallocated the memory, so it atleast won't perform worse then an array if you know the size beforehand :P
Avatar
let's pray for c++23 to throw away the C compatibility
Avatar
[quakenet] Dune BOT 2019-12-17 18:12:52Z
possible but then just use a static array if you know the size
18:13
EASTL is a good lightweight alternative iirc
Avatar
D
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:13:42Z
If not for the C standard holding the C++ commitee down, they'd have turned the entire language into some meta language of templates
Avatar
as far as I know, stuff like std::vector, std::unique_ptr, std::shared_ptr are fine
18:13
@Dune
Avatar
[quakenet] Dune BOT 2019-12-17 18:13:54Z
+1 Learath2
18:14
std::vector is not the worst iirc
Avatar
and maybe cut off the 40 year olsd stuff that's still being supported
Avatar
[quakenet] Dune BOT 2019-12-17 18:14:10Z
The STL has absurd implementation standards for performance predictability that prevent better implementations
Avatar
can you name concrete things that affect std::vector? I can't imagine any
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:14:31Z
@jxsl3 any particular C things that you don't want in your C++?
18:14
@heinrich5991 a bad reallocation strategy?
Avatar
[quakenet] Dune BOT 2019-12-17 18:15:00Z
trying to find the LLVM benches that show their vector designed for small sizes performs better than vector even on huge arrays
Avatar
true. I don't think it's specified by the standard, but let's check
Avatar
what was it called again, the Binary Application Interface of C is fully supported and not above that, thus preventing features?
Avatar
[quakenet] Dune BOT 2019-12-17 18:15:55Z
as far as implementation details go, I remember hashmaps has something that enforces that the pointer to some elements cannot change in some bizarre scenarios
Avatar
yes
18:16
I agree that hashmaps are bad, becaue they enforce linked list buckets IIRC
Avatar
[quakenet] Dune BOT 2019-12-17 18:16:46Z
the simple fact that implementations could not change for decades should indicate that this library is unsuited for performance
Avatar
heated debate 😮
Avatar
[quakenet] Dune BOT 2019-12-17 18:16:58Z
but you're right, I'd like to have concrete examples of vectors
Avatar
std::vector doesn't need to change in decades, tbf
18:17
it's a glorified array, arrays haven't changed in 70 years
Avatar
[quakenet] Dune BOT 2019-12-17 18:20:01Z
iirc the one container that is fine is the string
18:22
heinrich5991: did you find out if the reallocation strategy is specified by the standards?
Avatar
is the 1000 of Smallvector a predefined allocation size?
Avatar
it doesn't look like it
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:23:55Z
Dune: I took a look at the standard and didn't really see it specified, however it might be inferred from the wording that new_size is just enough to fit the new item
Avatar
only that it's amortized O(1)
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:24:06Z
which would be a bad strategy
Avatar
that wouldn't be amortized O(1) then
Avatar
[quakenet] Dune BOT 2019-12-17 18:24:35Z
iirc actual algorithms aren't in the standard, but strange specific behaviours are, and lock into some possibilities
Avatar
for hashmaps
Avatar
*too high for me, leaves to play Anno 1800 ._., @Learath2 remove the line, just giving my 2 cents here.
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:27:26Z
@heinrich5991 where did you see it's amortized O(1)?
Avatar
that's something I remembered, let me check
18:30
23.2.3 (sequence containers) 16
Avatar
heated debate continues
Avatar
Table 101 lists operations that are provided for some types of sequence containers but not others. An implementation shall provide these operations for all container types shown in the “container” column, and shall implement them so as to take amortized constant time.
18:30
a.push_back(t)
Avatar
[quakenet] Learath2 BOT 2019-12-17 18:31:07Z
I see
Avatar
I spend a lot of time with the C++ Standard Template Library. It is available on diverse platforms, it is fast and it is (relatively) easy to learn. It has been perhaps too conservative at times: we only recently got a standard hash table data structure (with C++11). However,...
18:43
"stl vectors are fine"
Avatar
fair enough
Avatar
A library that I work on often these days, meshoptimizer, has changed over time to use fewer and fewer C++ library features, up until the current state where the code closely resembles C even though it uses some C++ features. There have been many reasons behind the changes - ...
18:55
compiler std::vector arrays gcc 334 ms 318 ms clang 327 ms 297 ms clang libc++ 328 ms 299 ms msvc 285 ms 265 ms
18:58
Release performance also slightly increased across the board - this is because for many of our arrays, the default initialization performed by std::vector’s constructor is redundant as we’re going to fill the array anyway. With std::vector, you can either resize a large array and then compute the items (which requires default-initializing every item redundantly), or reserve and push_back repeatedly (which requires a bit more code for adding each item, and this overhead can also add up). With a custom container it’s easy to have an option to skip initialization - in fact, in our replacement that’s the only option since it’s easy to memset the array manually if necessary.
18:58
that's a reason for std::vector to be less performant than our own container type
Avatar
Some time last year during a regular lunch time C++ discussion at work somebody said “there’s a good language subset of C++, C with classes”, to which I replied “there’s an even better subset, C with structs”.
huh :)
Avatar
[quakenet] Learath2 BOT 2019-12-17 19:03:19Z
Somebody doesn't like OOP :P
19:03
Not that I enjoy oop
Avatar
I think it's nice if you minimize the amount of abstractions you use
19:04
A lot of OOP code seem to have a dick competition in making the most abstract, generic code
19:04
Abstraction has a cost
Avatar
that's a too general statement
19:04
(i.e. it's too handwavy to argue with it)
19:05
you can say "it has a cognitive cost. it has a compile-time cost. it has a runtime cost"
19:05
not all abstractions have a runtime cost
19:05
some abstractions have a negative cognitive cost
19:06
but in a way, C is an abstraction of assembly, isn't it
Avatar
can't watch a movie rn
19:06
yea
Avatar
[quakenet] Oy BOT 2019-12-17 19:07:47Z
is there a picture with the eye outline?
Avatar
[quakenet] Dune BOT 2019-12-17 19:08:24Z
well, zatline had sent me two pictures, with/without the outline
19:08
but I can't tell which one has the outline
Avatar
[quakenet] Oy BOT 2019-12-17 19:13:02Z
hm ok
Avatar
And it should probably affect the whole menu -> doesn't it?
Avatar
[quakenet] Oy BOT 2019-12-17 19:17:47Z
dunno, din't test it :P
19:17
u wrote server browser and settings
Avatar
Yeah. Demos too.
Avatar
[quakenet] Oy BOT 2019-12-17 19:18:16Z
yeah and ingame
Avatar
It was an accident
19:18
I like to call it a feature
Avatar
[quakenet] Oy BOT 2019-12-17 19:19:29Z
:D
Avatar
I wrote something that uses the settings.cfg to figure if the last version is <= 073 and set the winter background if not. So that people get to see it upon upgrade once
19:21
None stays none for theme haters :p
19:21
Not sure if scanning settings.cfg is the clean way though
Avatar
[quakenet] Oy BOT 2019-12-17 19:25:07Z
u could check if it finds the new settings0.7.cfg. if it doesn't u know :P
19:31
the concept
19:32
might be useful to extract thatinfo in a variable
19:32
but as u hinted its useless for now
Avatar
[quakenet] Oy BOT 2019-12-17 19:33:56Z
shows "There isn’t anything to compare."
19:34
yeah, we should probably add a simple way how we can get that information in the future
19:35
oh wait, didn't we have an issue before where we changed the default value and how that should be handled?
Avatar
[quakenet] Dune BOT 2019-12-17 19:52:57Z
kinda but that's different imo
19:53
wrong branch
Avatar
[quakenet] Oy BOT 2019-12-17 20:06:04Z
we could add that config "lastversionplayed" for 0.7.4 and set its default value to 0.7.3, then you don't have to parse sth
20:06
and on exit of the client we update it
Avatar
[quakenet] Dune BOT 2019-12-17 20:06:40Z
ooh
20:06
and we make it a saved config
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:08:26Z
I tried to chop up gamecontroller into pieces so that it'd be easier to mod, but gamecontroller is so deeply engrained
Avatar
[quakenet] Oy BOT 2019-12-17 20:09:45Z
Dune: yeah
20:09
Learath2: thought about that too
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:10:17Z
imho, IGameController should be stripped down to an interface, we should let controllers register commands so we can move the team/mod related commands out of CGameContext
Avatar
[quakenet] Dune BOT 2019-12-17 20:11:27Z
oh Learath2 had a bug in the gameworld destructors we need to keep track of
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:11:58Z
Dune: it's not really that important, it's just a harmless double call if you have a single gameworld
Avatar
[quakenet] Dune BOT 2019-12-17 20:13:32Z
it would be nice to fix it in the base code still tho
20:13
GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects.
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:14:18Z
anyways, I was thinking multiple inheritence for gamemodes, so something like class CCTFController : public IVanillaController, public ITeamController, public IFlagController
20:14
Is that way too ugly? :P
Avatar
[quakenet] Oy BOT 2019-12-17 20:14:43Z
kinda :P
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:14:58Z
Yeah, that's why I scrapped it :/
Avatar
[quakenet] Oy BOT 2019-12-17 20:16:18Z
Dune: the default, max value of the config value isn't correct
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:16:27Z
eh, I'll give it another go tomorrow, maybe I'll come up with something better
Avatar
[quakenet] Oy BOT 2019-12-17 20:16:46Z
ok :)
20:17
player probably needs some cleanup too
20:19
and if(g_Config.m_ClLastVersionPlayed < 0x0703) <- "<="
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:19:43Z
what is your stance on dynamic_casts btw? just so I don't end up with something you won't merge :P
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:20:05Z
where would you need those?
Avatar
we have them all over don't we?
Avatar
[quakenet] Oy BOT 2019-12-17 20:20:29Z
just the interfaces?
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:20:58Z
Dune: I don't see any dynamic_cast in the source
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:21:06Z
heinrich5991: Well it's a way of handling the class hierarchy
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:21:43Z
dynamic_cast is for downcasting something like a CEntity to a CCharacter, right?
20:21
(and checking whether the type is correct)
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:22:11Z
Checking whether the type is correct is the use case I was thinking
20:23
Currently most mods will just do a cast to (CModGameController), assuming the cast is safe
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:23:09Z
ah
Avatar
heinrinch5991: aren't some of the implicit C style casts dynamic ?
Avatar
no
20:24
dynamic casts check that the types match at runtime
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:25:02Z
I guess it'd be better if I can avoid calling gamemode specific functions from cgamecontext but then the interface for igamecontroller needs to support teams
20:25
basically I'm trying to think of a way to avoid the current IGameController::IsTeamplay()
20:26
(I think the compiler is allowed to optimize a dynamic_cast, so it doesn't have to be at runtime)
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:26:09Z
trying to understand the reasoning. what are the downsides of the current approach?
20:26
yes
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:26:59Z
Currently inheriting from IGameController isn't much of a use because it has very gamemode specific behaviour
20:28
IGameController is also a little hard to read and I think the handling of teams there is one of the things that makes it hard, thus I'm trying to think of a way to abstract that away, without having to repeat code in tdm and ctf e.g.
20:29
Tbh, if nothing atleast IGameController should be made into an ABC so it's atleast easy to inherit from
Avatar
[quakenet] Oy BOT 2019-12-17 20:34:00Z
you want to split administrative and gameplay stuff?
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:34:54Z
Administrative as in?
Avatar
[quakenet] Oy BOT 2019-12-17 20:35:24Z
everything that is in there and that's not gameplay related
20:36
like team balance/change etc. stuff
20:37
map change
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:37:13Z
I think they should be separated yes
Avatar
[quakenet] Oy BOT 2019-12-17 20:38:59Z
yeah, thought about that too
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:39:38Z
But even more then that the gamecontroller just needs to be more abstract. Some mods don't have a concept of matches, rounds, teams, map cycles, warmup, tournaments
20:40
All the code is there as soon as you inherit from IGameController and you end up overriding most of it just to get things working
Avatar
[quakenet] Oy BOT 2019-12-17 20:42:20Z
you pretty much just need the virtual functions: wincheck, on spawn/death,...
Avatar
IGameControllerTeam : public IGameController
Avatar
I tried to make a mod using only the mod controller, you can barely do cool stuff
20:56
Well at the end u might modify some projectiles here a laser there so it never feels "clean"
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:56:23Z
the d7 branch of ddnet7 is trying to be minimally invasive, but I did have to touch igamecontroller at the end
Avatar
Ye there is no way around it
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:56:57Z
entities worst case you can create your own
Avatar
oh there are way more invasive mods
Avatar
Well u alwsys end up using vanilla entities u just handle them diferently in ur entity class
20:57
But modding in tw always feels hacky
20:57
I dont get the pleasure i get from modding minecraft with forge
20:57
I know its very subjective
20:58
Tw protocol needs a change so its more dynamic
Avatar
espacially the netprotokoll
Avatar
Sending ur own textures and stuff
Avatar
[quakenet] Learath2 BOT 2019-12-17 20:59:20Z
well heinrich5991 did modify most of the protocol to be extendable, but that's not in 0.7 yet is it?
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 20:59:34Z
that's only ddnet to be precise
Avatar
even the ip header hat reserved bits for future
20:59
*had
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:00:15Z
I think the protocol extensions we made on ddnet are quite nice, maybe you could get those into teeworlds
Avatar
yes, but those are unfortunately useless due to ossification
21:00
i.e. firewalls around the world drop packets if you set those bits
Avatar
did you see ipv6?
21:01
it has a dynamic header sice and you can add subheaders as much as you want
21:01
*size
Avatar
My isp still doesnt have ipv6 support
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:02:22Z
I don't really know much if any residential isp that deployed ipv6
Avatar
Their dns server does tho
Avatar
my isp has ipv6
Avatar
Orange has ipv6 support
21:02
I was with then sometime
Avatar
my uni dropped ipv6 3 years ago, I believe due to deploying a nat
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:02:52Z
I knew of Orange, what do you have heinrich5991
Avatar
telekom
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:03:22Z
I'd wager most isps would deploy 50 NATs on top of eachother before deploying ipv6
21:03
NAT is pretty well implemented in hardware nowadays, blazing fast
Avatar
my point is not sending ipv6 packages, just implementing something like it for teeworlds
21:04
so you can easily add stuff like serversided auto grenade pickup
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:04:41Z
auto grenade pickup?
Avatar
auto weapon pickup on server side
Avatar
U mean switching to the weapon on pickup
Avatar
you can grab a weapon, shoot the old weapon, and then autoswitch with the current system
Avatar
Pickup is serverside already
Avatar
NO IT ISNT
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:05:41Z
we have a pretty decent way of extending the protocol for ddnet, you can do extra netmsgs, extra netobjects, extra snapitems
Avatar
Ur confised
Avatar
example
21:06
that's how we can extend the protocol
Avatar
Auto pickup is not the same as auto switch on pickup
Avatar
excuse me, i mean autoswitch
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:06:42Z
But the protocol is atleast nicely extendable thanks to NETMSG_NULL or equivalent
21:07
Minimally invasive modding is pretty impossible
Avatar
When it's in official teeworlds you can just add netmessages. The extended protocol is useful for mods thought. But you always need a custom client then
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:07:36Z
redix: but when you add netmessages you get issues with compatibility
Avatar
unless teeworlds includes a general api (which is fairly impossible) you probably can't do minimal invasive mapping
Avatar
Yeah you have to check the version before sending
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:08:27Z
@Assa fairly impossible is what I'm trying to achieve by abstracting away stuff
Avatar
I made mods breaking nearly everything in teeworlds
Avatar
A few netmessages have already been added since 0.7 release
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:09:13Z
@redix which is not the best way to handle things imho, if teeworlds intends to be mod friendly this time around, I think it's pretty important to provide a stable framework to extend the protocol
Avatar
you can't write an api which includes every potential idea a teeworlds developer might need
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:10:11Z
@Assa yes but you can create enough hooks that most anything can be implemented, if something else is needed then they can always contribute it back to teeworlds
21:11
Or you can try to isolate behaviour instead, e.g. keep the gamemode specific behaviour out of core
Avatar
it's mostly the engine where I see the problem
Avatar
is it?
21:12
what do you need there?
Avatar
in teeworlds are some singletone interfaces
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:13:06Z
huh, in vanilla the engine is pretty decently separated
Avatar
like IStorage
Avatar
CGameServer usually doesn't need IStorage
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:13:34Z
The singleton pattern is a completely acceptable pattern
Avatar
in fact, I checked earlier today:
Avatar
but IMap for example
Avatar
> rg RequestInterface src/game/server/ src/game/server/gamecontext.cpp 1437: m_pServer = Kernel()->RequestInterface<IServer>(); 1438: m_pConsole = Kernel()->RequestInterface<IConsole>(); 1465: m_pServer = Kernel()->RequestInterface<IServer>(); 1466: m_pConsole = Kernel()->RequestInterface<IConsole>(); 1492: CTile *pTiles = (CTile *)Kernel()->RequestInterface<IMap>()->GetData(pTileMap->m_Data); (edited)
Avatar
[quakenet] heinrich5991 BOT 2019-12-17 21:14:28Z
sorry
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:14:31Z
:D
Avatar
I wrote a mapgenerator in teeworlds, I broke a lot of engine stuff
Avatar
[quakenet] Dune BOT 2019-12-17 21:14:44Z
rip irc
21:15
all this stuff would be server side right?
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:15:54Z
stuff?
21:16
i needed to add sdl2 to the server side
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:16:20Z
Wait, why? :D
Avatar
wait what
21:16
😛
Avatar
so i can add textures to the generated maps
21:16
technically you could add a viewer and watch the server, too xD
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:17:02Z
Are you rendering the textures on the fly aswell?
Avatar
good question
Avatar
The png loading code is mixed with the opengl/sdl code.
Avatar
I added @LordSk 🦋 s editor on the server side
21:19
so i don't know how it works, but yes, png loading is mixed opengl/sdl code
Avatar
Might be easier to copy the png code from there
21:19
Instead of linking all the stuff from the client
Avatar
only sdl2, and only bam works now xD
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:20:54Z
anyways, tomorrow I'll make IGameController completely abstract so it's more pleasent to work with it in the meanwhile
21:21
If I find a decent way to chop it up and abstract away some other things, I guess that can be done later
Avatar
[quakenet] Dune BOT 2019-12-17 21:21:52Z
it would be nice if that'd make merges easier :)
21:22
it takes a lot of effort to write well contained server mods
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:23:17Z
I once had an idea for a "modloader" for teeworlds, even wrote one but it only had hooks for adding chat commands. It's really hard to create a nice api for this kind of thing
21:23
So I gave up on that and now I'm trying to isolate the gamemode from the gameserver
Avatar
I have an idea for a proxy teeverse server
21:27
but I am very sure the ping won't like it
Avatar
[quakenet] Dune BOT 2019-12-17 21:27:58Z
"proxy"?
Avatar
yes, you have a main world server, with a CTF, zCatch, tournament, yourmode, dunesawesome - mod-gates
21:28
and if you go into this gates, the server proxies you to other servers
21:29
so you connect indirectly to other servers without noticing
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:29:29Z
Well if the servers are on the same machine or atleast the same network, ping should be pretty low
Avatar
it has the huge advantage of abstraction and 'hiding' the ip of the subservers
Avatar
[quakenet] Learath2 BOT 2019-12-17 21:30:12Z
we had a similar idea of packing the entire state of the server and shipping it to another server in the case of ddos, but that turned out to be too much data :P
Avatar
you can do the same with switching the proxy
21:30
and thus archive ddos protection
21:31
note: as long as you have un-ddossed-proxies
Avatar
[quakenet] Dune BOT 2019-12-17 21:39:11Z
thats a pretty cool idea
21:39
the state of a server is that big?
Avatar
i guess you need to copy all of the server ram
21:42
so ~500 Mb?
21:44
i like the idea of a proxy, you could start server on demand
22:26
or is it something in ym network
22:26
my
22:26
A retro multiplayer shooter. Contribute to teeworlds/teeworlds development by creating an account on GitHub.
22:27
the image that's usually on the left side showing versions and repositories like AUR
22:27
right*
Avatar
GOD DARN IT, IT IS A COUNT DOWN IN DAYS, THE SERVER ICON, THAT IS 😮
23:21
holy molly!
23:22
heinrich staying up late to change it x)?
23:22
or dune :D?
Avatar
not me
23:32
I thought it stood for 0.7
23:32
but apparently not
23:32
must be santa changing it
Avatar
either christmas, 0.7.4 (my deadline) or both
Exported 406 message(s)