Page 4 of 8 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 76
  1. #31
    McSic's Avatar L e a d e r

    Join Date
    Dec 2007
    Posts
    8,961
    Thanked
    555
    Thanks
    7,974
    Reopened.

  2. The following user said thank you to McSic for this useful post:

    Frooples (01-01-2021)

  3. #32
    Junior Member

    Join Date
    Feb 2018
    Country
    Posts
    76
    Thanked
    136
    Thanks
    157
    Updated main post.

    Added:
    • Created bot manager (ZBotManager). Responsible for creating/destroying bots, and issuing commands to all bots.
    • Bots are now derived from the player (ZBotCharacter). Bots are pretty much of type MyZCharacter (The thing you play as), but with some features removed.
    • Added bypass for connection check for bots. I suspect this makes the bot client-sided. Need to find a way to test.
    • Added bots to peer list with a sentinel IP of "255.255.255.255" and port 0. Should be useful for making server sided bots in the near future.
    • Added death mechanics to bots. Bots stay dead until you respawn them with "/bot spawn".
    • Added godmode to bots. "/bot god"
    • Bots now contain your name.



    To be added:
    • Need to create ZNetBot so you can see other player's bots and bots in replays.
    • Need to consider bots in replays.
    • Need to fix player camera controlling bots.
    • Need to fix most ranged weapons not damaging bot.
    • Need to fix bots not dying in pits.
    • Need to add controllability.




    Here's an elevator with 0 ping.
    Last edited by Frooples; 01-02-2021 at 01:31 PM.

  4. The following 5 users say thank you to Frooples for this useful post:

    Amers (01-01-2021), Bunny (01-01-2021), Divine (01-07-2021), StephanM (01-01-2021), TomasEdison (01-20-2021)

  5. #33
    Junior Member

    Join Date
    Feb 2018
    Country
    Posts
    76
    Thanked
    136
    Thanks
    157
    Updated main post a tiny bit.

    Fixed player camera controlling bots. Bots now have their own independent camera. Before, they were facing whatever direction the player was at all times.

    Bots now switch to melee upon spawning.

    Started fiddling with controlling the bot. It's going hilarious.



    "/bot turtle" in real time. Blocks are too fast to register as a block.



    Last edited by Frooples; 01-06-2021 at 02:42 AM.

  6. The following 2 users say thank you to Frooples for this useful post:

    Amers (01-02-2021), TomasEdison (01-20-2021)

  7. #34
    Junior Member

    Join Date
    Feb 2018
    Country
    Posts
    76
    Thanked
    136
    Thanks
    157
    Cleaned up main post for future me and updated command list, because winter break is over (that was fast) and school is starting up. This project is on low priority again.

    I last left off on beginning to give the training bot some controllability. I need to find a way to send an action (like pressing shift to block) instead of copying and pasting code for blocking; This should naturally lead into implementing McSic's suggestion of a record/play mechanic where you can record your actions and have the bot replay them.



    Blooper.
    Last edited by Frooples; 01-06-2021 at 09:09 AM.

  8. The following 3 users say thank you to Frooples for this useful post:

    Amers (01-06-2021), StephanM (01-06-2021), TomasEdison (01-20-2021)

  9. #35
    Jordan's Avatar Cloud9 💨 💨 💨

    Join Date
    Dec 2009
    Country
    Posts
    389
    Thanked
    52
    Thanks
    35
    Originally Posted by Frooples View Post
    Cleaned up main post for future me and updated command list, because winter break is over (that was fast) and school is starting up. This project is on low priority again.

    I last left off on beginning to give the training bot some controllability. I need to find a way to send an action (like pressing shift to block) instead of copying and pasting code for blocking; This should naturally lead into implementing McSic's suggestion of a record/play mechanic where you can record your actions and have the bot replay them.


    Ahh i would say make it learn to play. Give it all the keys to the kingdom of course. Show it certain moves and what not and then have it quest and deep learn over and over till it can win a quest by rsing and such till it could stand on its own and then just keep making it learn and improve.

  10. #36
    Amers's Avatar Freestyler

    Join Date
    Aug 2015
    Country
    Posts
    588
    Thanked
    714
    Thanks
    416
    Originally Posted by Frooples View Post
    Cleaned up main post for future me and updated command list, because winter break is over (that was fast) and school is starting up. This project is on low priority again.

    I last left off on beginning to give the training bot some controllability. I need to find a way to send an action (like pressing shift to block) instead of copying and pasting code for blocking; This should naturally lead into implementing McSic's suggestion of a record/play mechanic where you can record your actions and have the bot replay them.


    That's epic how far you've gotten

    btw if u wanna use some haxs for quest and such https://streamable.com/0nwf9z

    Header file adminhax.h or whatever
    //forum.ragezone.com/f245/commands-hacks-admin-jork-1171006/
    static bool bLawn = false;
    static bool bMas = false;
    static bool bFlip = false;
    static bool bRe = false;

    void lawnmower()
    {

    bLawn = !bLawn;
    (bLawn == false) ? ZChatOutput(MCOLOR(255, 0, 0), ">Lawnmower") : ZChatOutput(MCOLOR(0, 255, 0), "Lawnmower");

    while (bLawn == true)
    {
    ZMyCharacter* m_pMyCharacter = ZGetGame()->m_pMyCharacter;
    MCommand* pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT_MELEE, MUID(0, 0));
    pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
    pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
    pNewCmd->AddParameter(new MCommandParameterInt(1));
    ZGetGameClient()->Post(pNewCmd);
    Sleep(20);
    }
    }

    void massive()
    {

    bMas = !bMas;
    (bMas == false) ? ZChatOutput(MCOLOR(255, 0, 0), ">Massive") : ZChatOutput(MCOLOR(0, 255, 0), "Massive");

    while (bMas == true)
    {
    MCommand* pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SKILL, MUID(0, 0));
    pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
    pNewCmd->AddParameter(new MCommandParameterInt(2));
    pNewCmd->AddParameter(new MCommandParameterInt(7));
    ZGetGameClient()->Post(pNewCmd);
    Sleep(20);
    }
    }


    void flipmower()
    {
    bFlip = !bFlip;
    (bFlip == false) ? ZChatOutput(MCOLOR(255, 0, 0), ">Flipmower") : ZChatOutput(MCOLOR(0, 255, 0), "Flipmower");

    while (bFlip == true)
    {
    MCommand* pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SKILL, MUID(0, 0));
    pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
    pNewCmd->AddParameter(new MCommandParameterInt(1));
    pNewCmd->AddParameter(new MCommandParameterInt(7));
    ZGetGameClient()->Post(pNewCmd);
    Sleep(20);
    }
    }


    void respawn()
    {

    bRe = !bRe;
    (bRe == false) ? ZChatOutput(MCOLOR(255, 0, 0), ">Respawn") : ZChatOutput(MCOLOR(0, 255, 0), "Respawn");

    while (bRe == true)
    {
    ZMyCharacter* m_pMyCharacter = ZGetGame()->m_pMyCharacter;
    MCommand* pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SPAWN, MUID(0, 0));
    pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
    pNewCmd->AddParameter(new MCommandParameterDir(m_pMyCharacter->GetDirection().x, m_pMyCharacter->GetDirection().y, m_pMyCharacter->GetDirection().z));
    ZGetGameClient()->Post(pNewCmd);

    ZGetGame()->ReleaseObserver();


    ZPACKEDSHOTINFO ShotInfo;
    ShotInfo.fTime = (float)timeGetTime();
    ShotInfo.posx = 0;
    ShotInfo.posy = 0;
    ShotInfo.posz = 0;
    ShotInfo.tox = 0;
    ShotInfo.toy = 0;
    ShotInfo.toz = 0;
    ShotInfo.sel_type = 1;

    pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT, MUID(0, 0));
    pNewCmd->AddParameter(new MCommandParameterBlob(&ShotInfo, sizeof(ZPACKEDSHOTINFO)));
    ZGetGameClient()->Post(pNewCmd);
    Sleep(20);
    }
    }
    Then go to ZChat_Cmds.cpp include the header and this stuff

    //admin stuff
    void ChatCmd_Respawn(const char* line, const int argc, char** const argv);
    void ChatCmd_Lawnmower(const char* line, const int argc, char** const argv);
    void ChatCmd_Flipmower(const char* line, const int argc, char** const argv);
    void ChatCmd_Massive(const char* line, const int argc, char** const argv);
    void ChatCmd_AdminCmds(const char* line, const int argc, char** const argv);
    then void initcmds
    // admin stuff
    _CC_AC("lawn", &ChatCmd_Lawnmower, CCF_ADMIN | CCF_GAME, ARGVNoMin, ARGVNoMax, true, "/lawn", "");
    _CC_AC("mas", &ChatCmd_Massive, CCF_ADMIN | CCF_GAME, ARGVNoMin, ARGVNoMax, true, "/mas", "");
    _CC_AC("flip", &ChatCmd_Flipmower, CCF_ADMIN | CCF_GAME, ARGVNoMin, ARGVNoMax, true, "/flip", "");
    _CC_AC("re", &ChatCmd_Respawn, CCF_ADMIN | CCF_GAME, ARGVNoMin, ARGVNoMax, true, "/re", "");
    _CC_AC("admin_cmds", &ChatCmd_AdminCmds, CCF_ADMIN | CCF_GAME, ARGVNoMin, ARGVNoMax, true, "/admin_cmds", "");
    // admin stuff
    void ChatCmd_AdminCmds(const char* line, const int argc, char** const argv)
    {
    if (!ZGetMyInfo()->IsAdminGrade()) { return; }

    ZChatOutput("Commands:", ZChat::CMT_SYSTEM);
    ZChatOutput("/lawn | /mas | /flip | /re | /admin_cmds", ZChat::CMT_SYSTEM);
    }

    void ChatCmd_Lawnmower(const char* line, const int argc, char** const arv)
    {
    if (!ZGetMyInfo()->IsAdminGrade()) { return; }
    if (!ZGetGame()) { return; }

    CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&lawnmower, 0, 0, 0);
    }

    void ChatCmd_Massive(const char* line, const int argc, char** const arv)
    {
    if (!ZGetMyInfo()->IsAdminGrade()) { return; }
    if (!ZGetGame()) { return; }

    CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&massive, 0, 0, 0);
    }

    void ChatCmd_Flipmower(const char* line, const int argc, char** const arv)
    {
    if (!ZGetMyInfo()->IsAdminGrade()) { return; }
    if (!ZGetGame()) { return; }

    CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&flipmower, 0, 0, 0);
    }

    void ChatCmd_Respawn(const char* line, const int argc, char** const arv)
    {
    if (!ZGetMyInfo()->IsAdminGrade()) { return; }
    if (!ZGetGame()) { return; }

    CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&respawn, 0, 0, 0);
    }
    "Nobody cares, work harder"
    Love everyone, but trust no one

  11. The following user said thank you to Amers for this useful post:

    Frooples (01-06-2021)

  12. #37
    Junior Member

    Join Date
    Feb 2018
    Country
    Posts
    76
    Thanked
    136
    Thanks
    157
    Thanks Amers, that code actually contains just what I need to send actions to the bot.

    And thanks for the suggestion Joad13. You are describing reinforcement learning. I will generalize the code to accept inputs from AIs, but it won't be the focus of this project.




    I was also thinking about adding an asura mode "/bot asura"


    All your bots copies your actions live, are always stuck inside you, and are offset from one another by 360/(number of bots + 1) degrees. Making you a multi-headed and multi-limbed demon called an Asura from Hindu mythology. Admins will be unstoppable.
    Last edited by Frooples; 01-07-2021 at 02:52 AM.

  13. #38
    Junior Member

    Join Date
    Feb 2018
    Country
    Posts
    76
    Thanked
    136
    Thanks
    157
    Was working on this because I was procrastinating.

    Updated main post.

    • Fixed bot's block giving you a massive.
    • Fixed ranged weapons not doing damage
    • Bots use rvectors for directions instead of cameras now.
    • Godmode now gives 99999999 Hp and Ap
    • Added /bot sf
    Safe-fall. When on, bot instantly gets up from the ground.
    • Added /bot aim [player name] [delay]
    Aims at you by default, but you may specify other players or bots. I was serious about bot battles.
    • Added /bot follow [player name]
    Bot follows you by default, but you may specify other players or bots. They will follow you over walls and pits.




  14. The following 2 users say thank you to Frooples for this useful post:

    Amers (01-15-2021), TomasEdison (01-20-2021)

  15. #39
    Amers's Avatar Freestyler

    Join Date
    Aug 2015
    Country
    Posts
    588
    Thanked
    714
    Thanks
    416
    Originally Posted by Frooples View Post
    Was working on this because I was procrastinating.

    Updated main post.

    • Fixed bot's block giving you a massive.
    • Fixed ranged weapons not doing damage
    • Bots use rvectors for directions instead of cameras now.
    • Godmode now gives 99999999 Hp and Ap
    • Added /bot sf
    Safe-fall. When on, bot instantly gets up from the ground.
    • Added /bot aim [player name] [delay]
    Aims at you by default, but you may specify other players or bots. I was serious about bot battles.
    • Added /bot follow [player name]
    Bot follows you by default, but you may specify other players or bots. They will follow you over walls and pits.

    Wow, so excited for this, Frooples you are doing a great job, this is amazing!
    "Nobody cares, work harder"
    Love everyone, but trust no one

  16. The following user said thank you to Amers for this useful post:

    Frooples (01-15-2021)

  17. #40
    Jonathan pls's Avatar Uh suma luma duma luma

    Join Date
    Jun 2013
    Country
    Posts
    826
    Thanked
    1,312
    Thanks
    494
    This is really cool man, nice progress

Page 4 of 8 FirstFirst ... 23456 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)