Page 1 of 2

Teeworlds Randomness (wtf?)

Posted: Sun Oct 15, 2017 11:51 am
by Im 'corneum
[BBvideo=560,315]https://www.youtube.com/watch?v=HbbvMb7 ... e=youtu.be[/BBvideo]
I think the point is pretty clear here, i just wanna know if this is fixable. I actually had to change the second part because it just wouldnt work anymore. (map: Freezejump)

Re: Teeworlds Randomness (wtf?)

Posted: Sun Oct 15, 2017 11:59 am
by Silex
#offtopic -> i like your signature, this hoe ain't loyal.


Yes i got the same problem multiple times on some maps too.

Re: Teeworlds Randomness (wtf?)

Posted: Sun Oct 15, 2017 2:43 pm
by VipeR

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 9:57 am
by Pipou
The problem occurs when you copy it to a new map because of the new location of the part. While I was mapping Hostile 2, I had the same problem with the last part and I noticed that there was a fonctionnal area which is 30 tiles off the top, right, bottom and left (if I remember well). When getting too close to the borders the parts physics work differently.

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 12:21 pm
by Im 'corneum
Pipou wrote: Mon Oct 16, 2017 9:57 am When getting too close to the borders the parts physics work differently.
I dont think it's only the borders, because In every clip i used, the part was pretty much in the middle of a big map. It must be some kind of pattern.

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 12:36 pm
by deen
We use floating point numbers to calculate the positions, velocity, etc. So the calculations are not exact and in a different location in the map you have a different amount of rounding error. Some more details: http://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf

I don't think we will be able to fix this without breaking the physics of existing maps.

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 12:57 pm
by Pipou
Oh ok interesting

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 1:45 pm
by Im 'corneum
@deen. Does this mean that for example, the shown parts can only have 2 outcomes based on where they are? Or is there even another possebility in yet another spot. How far does it go up?

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 2:14 pm
by ChillerDragon
Ah ye sure these floats. I also had problems hardcoding my ServerSide dummys. Because the x velocity gets diveded on slowing down.
---> If you stop moving (Pressing a or d) then your vel never gets 0.000000.

Re: Teeworlds Randomness (wtf?)

Posted: Mon Oct 16, 2017 3:38 pm
by deen
Im 'corneum wrote: Mon Oct 16, 2017 1:45 pm @deen. Does this mean that for example, the shown parts can only have 2 outcomes based on where they are? Or is there even another possebility in yet another spot. How far does it go up?
Yes, the physics in different parts of the map are slightly different. The absolute x and y locations count. If the map is huge, the physics will break entirely and any movement is impossible or your tee just starts flying around randomly. But probably the RAM is too small to make a map big enough.

If I were starting a game like this from scratch, I would use a fixed maximum size for the map and use fixed point numbers with deterministic behaviour everywhere.