26 (edited by necropotame 2015-12-22 20:53:15)

Re: [TeeUniverse] Devlog

I've changed my mind and I will start by the protocol, then the compatibility with 0.6. Here is the git repository

Modifications are right now limited. I've just added the broadcast system. You can use it with this code :

#include <modapi/message.h>

CModAPI_Msg_Broadcast BroadcastMsg(GameServer(), MODAPIALT_BROADCAST_CHAT);
BroadcastMsg.Send(ClientID, "Broadcast in ModAPI");

The MODAPIALT_BROADCAST_CHAT means that is the client is not compatible with Broadcast, a chat message will be displayed instead.

I will add the mod-package download later.

27

Re: [TeeUniverse] Devlog

I've added the mod package download. For now, it contains nothing, but the file is transfered to the client. It use the same system than for map, so the client need to download it only one time. The .mod file is generated when the server start, so no editors are needed.

const char* CServer::m_aModName = "mymod";

bool CServer::CreateMod(const char* pModName)
{
    char aBuf[512];
    str_format(aBuf, sizeof(aBuf), "mods/%s.mod", pModName);
    
    CModAPI_ModCreator ModCreator;
    
    //ModCreator.AddImage(...);
    //ModCreator.AddWeapon(...);

    ModCreator.Save(Storage(), aBuf);
    
    return true;
}

To create a mod, you just need to change "mymod" by the name of your mod, and then add some lines like ModCreator.AddImage(...) or ModCreator.AddWeapon(..).

Note : This thread is a kind of devlog. I did so to allow you to critic the interface of ModAPI.

28

Re: [TeeUniverse] Devlog

Good work so far I'd say smile Looks like it has potential to be useful one day smile

29

Re: [TeeUniverse] Devlog

In fact, this will be useful very soon smile The Mod Package will contains sprites and skins. Perfect for your wheel menu in NetGUI, for example wink

30

Re: [TeeUniverse] Devlog

I've committed sprites, only from game.png for now. You must add this line in CreateMod() to declare the sprite :

SPRITE_ID = ModCreator.AddSprite(MODAPI_INTERNALIMG_GAME, 15, 0, 2, 2, 32, 16);

MODAPI_INTERNALIMG_GAME is to specify that your sprite is from game.png. Then, you can enter X,Y cell, width, height, and the size of the cell in the image (32,16 for game.png).
You obtain an ID from this function that you can reuse to display sprites with NetObjects :

CNetObj_ModAPI_Sprite* pSprite = static_cast<CNetObj_ModAPI_Sprite*>(Server()->SnapNewItem(NETOBJTYPE_MODAPI_SPRITE, GetID(), sizeof(CNetObj_ModAPI_Sprite)));
pSprite->m_SpriteId = SPRITE_ID;
pSprite->m_X = (int) m_Pos.x;
pSprite->m_Y = (int) m_Pos.y;
pSprite->m_Size = 42;
pSprite->m_Angle = 0;

31

Re: [TeeUniverse] Devlog

Sorry I am late to the party.  For right now I think I like the way this thread is going.  In my opinion forking a project is an extreme last resort. Like Devs have completely abandoned ship and if you don't fork it Teeworlds would die and go away.  Right now the devs seem to be semi active, not as active as some would like but active enough.  The problem is that the devs are a bit hostile to modders which I see as a major problem. 

I think that the thing to do right now is continue working on what might seem like a fork and keep compatibility with 0.6 and 0.7 like this thread seems to intend to do.  But I really thing that this group of modders should reach out the the devs.  I know that you guys just want to get back to making your awesome mods, and the devs want to continue making vanilla great.  In my opinion vanilla should be a great standalone game without mods, and it should be a the best starting off point for a mod to make the game even better, wacky, silly or what ever.  It sounds like what Teeworlds really needs is a mod compatibility layer.

Now the devs do not want to work on anything mod related. So if you want this you are going to have to be the ones to make this.  I think what you need to do is one make this apiMod a good base for other moders to build on, but also come up with some ways to turn TeeWorlds into a mod frindly game but still remain Vanilla TeeWorlds.  possibly work with the devs there is no reason that the two groups can not work together to make TeeWorlds a better game.  The devs don't necessarily have to work on anything mod related but the two groups do need to work together.

Does this seem even remotely possible?

Jesus is my Lord and Savior. Praise be unto God for giving us a way to live with him.

Check out my DeviantArt for all my TeeWorlds art and ideas for Teeoworlds

32

Re: [TeeUniverse] Devlog

I was thinking about invite devs on the GitHub repository. It's done. I've added minus7, oy, Sonix-, Zatline and Landil. If someone is missing, please tell me.

33

Re: [TeeUniverse] Devlog

heinrich may be missing there, I think he's the only one who is very active in both vanilla development and mods (like ddnet)

34

Re: [TeeUniverse] Devlog

I don't know his GitHub account. If someone give me it, I will add him.

35

Re: [TeeUniverse] Devlog

tee please
https://github.com/heinrich5991

I will be banned if I troll again ...

36 (edited by necropotame 2015-12-26 00:15:04)

Re: [TeeUniverse] Devlog

@Deepfinder : Thanks, i've added him.

External sprites done !

http://s28.postimg.org/5qfi7p531/modapi_sprites.png

In this example, if the client is compatible with ModAPI, he download an image when he join the server and then, he can display sprites. If the client is not compatible, the server send a shield instead.
It's simple to do. Just two lines in CreateMod to add the image and the sprite

if(ModCreator.AddImage(Storage(), "modapi/example.png") != MODAPIEXAMPLE_IMAGE_WEAPONS) return false;
if(ModCreator.AddSpriteExternal(0, 0, 0, 1, 1, 16, 16) != MODAPIEXAMPLE_SPRITE_TARGET) return false;

and one other part to send the snapshot :

    if(Server()->GetClientProtocolCompatibility(SnappingClient, MODAPI_COMPATIBILITY_SPRITE))
    {
        CNetObj_ModAPI_Sprite* pSprite = static_cast<CNetObj_ModAPI_Sprite*>(Server()->SnapNewItem(NETOBJTYPE_MODAPI_SPRITE, GetID(), sizeof(CNetObj_ModAPI_Sprite)));
        pSprite->m_SpriteId = MODAPIEXAMPLE_SPRITE_TARGET;
        pSprite->m_X = (int) m_Pos.x;
        pSprite->m_Y = (int) m_Pos.y;
        pSprite->m_Size = 64;
        pSprite->m_Angle = 0;
    }
    else
    {
        CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, GetID(), sizeof(CNetObj_Pickup)));
        if(!pP)
            return;

        pP->m_X = (int)m_Pos.x;
        pP->m_Y = (int)m_Pos.y;
        pP->m_Type = PICKUP_ARMOR;
    }

37 (edited by [pieLover] 2015-12-26 01:11:13)

Re: [TeeUniverse] Devlog

necropotame wrote:

snip-- External sprites done !--snip

This excites me a lot. Progress in the form of screenshots is always great ^-^. What happened to the Linux (x64 i think) download link? sad edit: nevermind, there wasnt one. i was thinking of netgui 0.7.

Clan: Riot (I'm one of three leaders: Mile, Deku, pie)
Host teeworlds maps on a fng/ctf/dm/ddrace server for testing:http://riotproductions.tk/teewo/ broken-need reinstall nginx http://riotproductions.tk/bounce?whatEven, Teeworlds NA Discord chat

38

Re: [TeeUniverse] Devlog

The code is too young to share binaries right now. But you can definitely compile it on Linux, it easy smile

39

Re: [TeeUniverse] Devlog

http://s28.postimg.org/5qfi7p531/modapi_sprites.png

So if I am playing a apimod client/on a server the shield would be replaced with the target? But if I am playing vanilla I would see a shield?

Or would this be like a new game type were you would hit the targets and if you are playing vanilla the goal would be to shoot the shields?

Jesus is my Lord and Savior. Praise be unto God for giving us a way to live with him.

Check out my DeviantArt for all my TeeWorlds art and ideas for Teeoworlds

40 (edited by [pieLover] 2015-12-26 08:43:35)

Re: [TeeUniverse] Devlog

android272 wrote:

So if I am playing a apimod client/on a server the shield would be replaced with the target? But if I am playing vanilla I would see a shield?

Look at the source code snippets he provided ;D, yes, in ModAPI client you would see a target, and in vanilla you could see an armor entity.

but the mod maker can customize what you see as vanilla and ModAPI, and what position it's (or many it's) in: think, a tight circle made of armor entities, and a heart in the center, just as a backup for vanilla'ers and a giving of context that it's intended as a "target" to vanilla 0.7 players. cool, right?

Clan: Riot (I'm one of three leaders: Mile, Deku, pie)
Host teeworlds maps on a fng/ctf/dm/ddrace server for testing:http://riotproductions.tk/teewo/ broken-need reinstall nginx http://riotproductions.tk/bounce?whatEven, Teeworlds NA Discord chat

41

Re: [TeeUniverse] Devlog

android272 wrote:

So if I am playing a apimod client/on a server the shield would be replaced with the target? But if I am playing vanilla I would see a shield?

Or would this be like a new game type were you would hit the targets and if you are playing vanilla the goal would be to shoot the shields?

Yes, it's a new gametype, so there is a new entity called Target. But it's just an example. You can create doors, boss, vehicles with it wink

42

Re: [TeeUniverse] Devlog

I was mainly wondering if the target was actually replacing the shield with a new sprite or if it was indeed a target that you could shoot or something.  I know it is an example but it was unclear what these two objects would actually do in game.

Jesus is my Lord and Savior. Praise be unto God for giving us a way to live with him.

Check out my DeviantArt for all my TeeWorlds art and ideas for Teeoworlds

43

Re: [TeeUniverse] Devlog

In this example, if you shoot the target, the target explode and a new one appears randomly in the map. For vanilla client, the only difference is that the "image" for the target is replaced by the "image" of a shield. But in term of game-play, it's still a target.

44

Re: [TeeUniverse] Devlog

OK cool that's what I thought it would be like. That would actually be kinda cool as a solo target practice/tutorial, timed challenge (how fast can you take out 15 targets/you have a minute to take out 15 targets), take out the target before anyone else does.  I know this is just to show how the sprite system works but it would be kinda cool make some game types out of it.

Jesus is my Lord and Savior. Praise be unto God for giving us a way to live with him.

Check out my DeviantArt for all my TeeWorlds art and ideas for Teeoworlds

45 (edited by necropotame 2015-12-26 15:27:29)

Re: [TeeUniverse] Devlog

That's the plan smile The server-example branch on GitHub will be a new mod where you have to destroy as mush as possible targets in a limited time. Multiple players can play at the same time, but you can't deal damage to others and you can't hook them. This mod is a good demonstration of what ModAPI should be able to do.

Sometime, you have to shoot the target with laser that bounce on wall, so the reflected laser should has a different color, and new weapons must be added.
Sometime, you must hit the target, but not the bomb near it, or you will freeze for 3 seconds, so I have to implement freeze effect and skin change. Particles effect should also added to make good explosion of targets or of stunt bombs.
When you hit a target, "+1" must be display on top of the player, so I have to implement TextCharacter NetObject.
Sometime, the target is moving, so I must add an embded new TeeSkin to make NPC looks like a running target with eyes.

Since the rules of each round are randomly chosen, I can add many examples of what ModAPI can do.

46

Re: [TeeUniverse] Devlog

Thanks to Schwertspize, there is a server running the ModAPI example : 151.80.85.125:8100.

You can try the mod with vanilla 0.7 and ModAPI. Right now, there is no score system, it's just a server with target to shoot.

47 (edited by Henningstone 2015-12-26 18:03:51)

Re: [TeeUniverse] Devlog

The target doesn't explode tongue Also, I'd like to have my score counted ^^ (Mmh I need to watch out that I do not get addicted to this mod if the target explodes xD)

48

Re: [TeeUniverse] Devlog

I will fix that, so be careful with potential addiction wink

Right now, I'm working on line styles. The basic idea is to define in CreateMod a list styles that can be applied on lines. These styles should be able to look similar to lasers and hooks. But the number of possibilities are huge (tentacles, laser beam, water fall, dashed lines, ...). So the laser rifle can shoot different colors, and the style of the hook can be also changed (zombies with long tongue smile ). For Infection/InfectionClass, laser wall can be displayed as true laser beam with good end points.
The good point is that the new NetObject_ModAPI_Line that allows to send lines can be easily replaced by a simple NetObkect_Laser.

49 (edited by android272 2015-12-27 04:42:39)

Re: [TeeUniverse] Devlog

Posted this some time ago.  You were talking about adding different hooks for different game types eg. some infected zombie classes could have long tongue.  A moder could create a hook that uses this sprite layout.  It is devided in this way to resemble how the tees skins are now put together.

Im not sure what is wrong with this preview image but here is a tongue for someone to use in their infection game.
http://orig12.deviantart.net/282d/f/2015/360/b/a/tongue_hook_by_android272-d9llb8v.png

android272 wrote:

I would like to suggest some improvements to the look and feel of the hooks.

Hooks in Teeworlds are very stiff and move through objects when in the real world they would bend around the object it were to hit. 

I think it would look a lot better if the chain were to have actual links that could pivot and bend as they hit objects on the Game layer.

Show Off Hook

The hooks are put together like the tee skins are.  There is the color layer and the shadow layer. The first and last block move 16 px in on the second block and the second block goes on top of the two blocks.  The yellow dots are the pivot points.

Hook Explain


I wanted only to see what the default chain would look like but what a rope hook and razor hook would look like.

Chain Hook
Rope Hook
Razor Hook

The source files can be found in any of the following links, it does not matter which one you click on they all have the same source file in them.  Chain Hook, Rope Hook, Razor Hook. There is a green download button on the right side of the page.
________________________________________________________________________________
License: Creative Commons License - Attribution - Commercial use - Share Alike (CC BY 4.0)
TL;DR:

CAN:                             CANNOT:            MUST:
Commercial Use          Sublicense         Give Credit
Distribute                                                  Include Copyright
Modify                                                       State Changes
Rename

Note: I don't care too much about giving me credit or that you state changes as much as this copy right must stay with what ever is copied or modified.

Jesus is my Lord and Savior. Praise be unto God for giving us a way to live with him.

Check out my DeviantArt for all my TeeWorlds art and ideas for Teeoworlds

50 (edited by necropotame 2015-12-27 10:54:09)

Re: [TeeUniverse] Devlog

This proposition is good, but curved hooks is too hard to maintain compatible with vanilla in term of gameplay. But for the graphical part it's okay and I will implement it. We can even add a NetObject_ModAPI_BezierCurve or NetObject_ModAPI_Spline4. This will allows to make cool "moving death curve" instead of "death tile". Or moving freeze curve for DDRace.

Right now, the line is made of two colored quads to imitate lasers, and an option to add a list of sprites on the line. The list is used for animation, but a can add an option to use it to tile the line with different sprites. And an option to allow overlapping. End points are also in the line style. It could be something like that :

struct ModAPI_LineStyle
{
     int OuterWidth;
     vec4 OuterColor;
     int InnerWidth;
     vec4 InnerColor;
     
     int LineSpriteType; //List, Animation
     int LineSprite1;
     int LineSprite2;
     int LineSpriteSizeX;
     int LineSpriteSizeY;
     int LineSpriteOverlapping;
     int LineSpriteAnimationSpeed;
     
     int StartPointSprite1;
     int StartPointSprite2;
     int StartPointSpriteX;
     int StartPointSpriteY;
     int StartPointSpriteSizeX;
     int StartPointSpriteSizeY;
     int StartPointSpriteAnimationSpeed;
          
     int EndPointSprite1;
     int EndPointSprite2;
     int EndPointSpriteX;
     int EndPointSpriteY;
     int EndPointSpriteSizeX;
     int EndPointSpriteSizeY;
     int EndPointSpriteAnimationSpeed;
     
     int AnimationType; //None, ScaleDown, Fading
     int AnimationSpeed;
};

Small question: why do you use shadow layer ? Is it different to just merge both ?