GithubHelp home page GithubHelp logo

Comments (36)

T-Maxxx avatar T-Maxxx commented on July 19, 2024 3

I just added function for prediction player movement so bots looks a bit overpowered now ^^.
Youtube

from cod4x_server.

D4edalus avatar D4edalus commented on July 19, 2024 2

sounds like a nice feature. i haven't yet experimented with bots in any way. but i always disliked that i need pezbots mod to test the simplest features. guess it would be nice to have the option to improve the AI :)
maybe somebody is motivated to develop an AI plugin in the future. 👍

from cod4x_server.

PureTryOut avatar PureTryOut commented on July 19, 2024

That is cool, it's stupid that bots couldn't do that in the first place. Could we see general bot AI improvement overall in Cod4X? It would be good to not need Pezbots anymore in the future for proper bots.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

It is hard to write bots AI using gsc, even harder with C. And this movement under control of gsc scripts.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

So? You want these features or not?

from cod4x_server.

D4edalus avatar D4edalus commented on July 19, 2024

Sorry i was offline this week :)
So this would be functions that can be executed on a player via gsc to
perform all the possible movement styles? Leanleft/leanright, crouch, jump
whatever?

2016-07-11 5:56 GMT+02:00 Max [email protected]:

So? You want these features or not?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/D4edalus/CoD4x_Server/issues/20#issuecomment-231637241,
or mute the thread
https://github.com/notifications/unsubscribe/ARP0TC66zXlzAFwQE38jLdzrxwTgSE7Sks5qUb8JgaJpZM4JFxoo
.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Yes. You spawn bot as usual using command line or gsc scripts and then you use something like "self moveforward()" and bot begin move. Unfortunately, this commands will not work for players.

from cod4x_server.

PureTryOut avatar PureTryOut commented on July 19, 2024

Is this confirmed to be implemented in the future? Currently seems to be a bit dead as there is no confirmation yet

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

I don't know. Still waiting for confirmation...

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

How are you going to do that? Emitting usercmd packets into the SV_ClientThink() function every frame? That is what I'd prefer here so it looks like a real player moves them. I think Quake3 bots work over the same function.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Yes. SV_ClientThink() applies some logic to bots' usercmds before actual movement so this is best place.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Would be nice if you could do it then.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Okay I have commited the functions IW used to move bots. So you should have it easier now.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Just tested movement. Its ok.
From the other hand, function called each server frame(20 times per second) so its impossible to make smooth bot rotation. Smooth like its 250 FPS ofc.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Well that isn't correct. Clients see updates only every 50msec as well. When you have one update every serverframe it should look similar to other players moving on server. On clientside there happens interpolation between the current snapshot and the prior snapshot.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

There is something weird with angles in usercmd. I can't identify its units. On screenshot you can see its value in integer and there should be rotation for 180 degrees from current origin but in fact there is <10 degrees actually in game.
The game shows extremely small numbers(XXe-41) when i'm grabbing vector from player usercmds. This is definetely not integers.
image
Hmm. Hexadecimal representation of its components always 2 bytes: so its values from 0(0deg) to 65535(360deg)?

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Its direction is not constant and somehow related to spawn direction. (Sometimes 0 its west sometimes its not).

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Well in the alpha xbox version of CoD4 its a 3 dimensional int vector.
I can examine the binary again and see if that offset in usercmd_t struct is making sense.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Well I am quite convinced that it is right as it is:
http://img.i-g.ninja/489ccdd8471eadb9d7732187112809c6

angles starting at offset 0x8

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Yes, its 3 dimensional int vector but only LOWORDs are in use. I have found how to work with them. You were right - rotating smooth like I'm spectating after human.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

Wasted 2 or 3 days because of wrong 65535-0 and 0-65535 ucmd angles transitions. But now it looks sexy.
Youtube

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Nice you got that to work!

from cod4x_server.

PureTryOut avatar PureTryOut commented on July 19, 2024

That looks awesome! Soon we can have proper bot matches lol

from cod4x_server.

PureTryOut avatar PureTryOut commented on July 19, 2024

Except for the horrible desync you seem to be having, that is amazing! Maybe eventually a setting could be added for bot difficulty, ranging from very easy to hard like this. That would make proper bot matches possible.

Do you know what is up with that desync though?

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Any idea why in killcam it looks like he is so much time off? Do you really use the current servertime and not something old when sending usercmds?

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

ucmd.serverTime zeroed at line 10, I'm not touching it. Scripts and killcam are from vanilla CoD.
Thats everything I'm doing for bots in this function for now. (And looks like thats all I need.)

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

ucmd.serverTime = Sys_Milliseconds(); didn't help.
Maybe this is because game still thinks its 1k ping for bot? (lag icon present) And all actions looks like 1 second faster than actual shots fired.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

ucmd.serverTime = svs.time;

I am wondering how you can hit at all when you provide a so much wrong server time.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

It hits perfect but impacts on demos and killcams.
Done. No desync anymore.
What is svs.time exactly? Time from map start? Or whole server?

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Whole time server is running for in milliseconds. Most stuff uses it as base. It's resolution is only serverfps however. Time is constant during each frame where Sys_Milliseconds() isn't.

from cod4x_server.

IceNinjaman avatar IceNinjaman commented on July 19, 2024

Does it still show the disconnected icon?

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

No.

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

So, don't you want to accept #45? It's ready and I want to focus on something more important.

from cod4x_server.

PureTryOut avatar PureTryOut commented on July 19, 2024

Do you have a video of the bots without desync btw? Or what commands would I need to run to get such a bot in a private game running your PR?

from cod4x_server.

T-Maxxx avatar T-Maxxx commented on July 19, 2024

No, I haven't.
You can use my _globallogic.gsc with empty mod on mp_backlot.

from cod4x_server.

D4edalus avatar D4edalus commented on July 19, 2024

that is very cool stuff! i have pulled it to a separate branch for now as it is a lot to look over.

from cod4x_server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.