1 (edited by xavierp94 2010-08-12 14:31:48)

Topic: [SOLVED] Game Collision Help

I have recently encountered an annoying problem with my custom built version of Teeworlds. I implemented a patch from Dune's Teeworlds Gamer Client that that only renders the game tile, which is sometimes very useful in races to find secret ways. Well everything went well with the patching because I used this one he provided to patch the teeworlds-0.5.2-src. I complied and no errors! I thought I had reached success until I went onto a DDRace or a modded server. I noticed that the client froze a lot so eventually I figured out that the client predicted that every other tile or entities that weren't solid, no hook, death, or weapons was a solid tile so that explained why every time that I fell on a freeze tile inside a DDRace server for two seconds my client reported me as being able to stand or hook the freeze tile until the server told my client that it wasn't supposed to do that. That was why my client froze often. Any one can help me with this? I provided with screenshots and the patch I used and the source code I am currently working with. The culprit file I believe that is the one that is causing this would be the collision.cpp file because I reversed the patch on that file and the client didn't do that anymore but didn't show me the full gamelayer.

Culprit Code:

Before Patch

for(int i = 0; i < width*height; i++)
    {
        int index = tiles[i].index;
        
        if(index > 128)
            continue;
        
        if(index == TILE_DEATH)
            tiles[i].index = COLFLAG_DEATH;
        else if(index == TILE_SOLID)
            tiles[i].index = COLFLAG_SOLID;
        else if(index == TILE_NOHOOK)
            tiles[i].index = COLFLAG_SOLID|COLFLAG_NOHOOK;
        else     
        tiles[i].index = 0;
    }
                
    return 1;
}

After Patch

for(int i = 0; i < width*height; i++)
    {
        int index = tiles[i].index;
        
        if(index > 128)
            continue;
        
        if(index == TILE_DEATH)
            tiles[i].index = COLFLAG_DEATH;
        else if(index == TILE_SOLID)
            tiles[i].index = COLFLAG_SOLID;
        else if(index == TILE_NOHOOK)
            tiles[i].index = COLFLAG_SOLID|COLFLAG_NOHOOK;
        else     
        tiles[i].index = index;
    }
                
    return 1;
}

Patch:
http://duneudne.free.fr/source/patches/ … ower.patch

Screenshots:
http://img198.imageshack.us/img198/2959/screenshotgqj.png
Uploaded with ImageShack.us

http://img101.imageshack.us/img101/5627/screenshot2nu.png
Uploaded with ImageShack.us

Source Code:
Download teeworlds-0.5.2-src.zip

2 (edited by Dune 2010-08-12 07:40:42)

Re: [SOLVED] Game Collision Help

This problem comes from my client.
I fixed the collision issue on the last versions of my client, but did not think to update the separated patch.
Apologies, I will fix that very soon and edit this post.

Edit: Fixed, link is always the same (Fixed patch).
Enjoy!

Not Luck, Just Magic.

3

Re: [SOLVED] Game Collision Help

well its not really a good idea to mix up collisions flags with other things xD

actually... We dont support mods!

uptee - a simple web interface for hosting and maintaining teeworlds servers
teerace - a website gathering results of trusted Race-mod servers providing global ranking and statistics
*gV* rox ^^

4 (edited by xavierp94 2010-08-12 14:30:37)

Re: [SOLVED] Game Collision Help

Dune wrote:

This problem comes from my client.
I fixed the collision issue on the last versions of my client, but did not think to update the separated patch.
Apologies, I will fix that very soon and edit this post.

Edit: Fixed, link is always the same (Fixed patch).
Enjoy!

Ok thank you a lot! I really appreciate it.

5

Re: [SOLVED] Game Collision Help

all you will get in tw forums we don't support mods if your questions is about a mod go to their forum like this http://ddrace.info/forum/

if you are looking for support for DDRace, please go to http://DDRace.info.