Announcement

Collapse
No announcement yet.

CSQC Player 0.0001

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSQC Player 0.0001

    CSQC player alpha 0.0001 (for darkplaces engine only)

    By Christian Ice

    CSQC Player - test 1 - YouTube

    This release is meant only for developers, hopefully they can help me fixing some issues with the code.

    For anybody else, feel free to take a look at the code and grab what you need, but at this point a documentation is a waste of time, this is NOT a release meant to be used as a mod in any way (yet).

    Anyway the main features are:

    Client side player (no prediction whatsoever)
    Interpolate model (via qc, the server does it automatically, here I coded it)
    full skeletal control (even the jacket that flaps with the wind
    Separated animations.
    I just coded the basic "legs", so they react to player movements without any information sent from the server.
    The upper part has yet to be coded
    adaptive stand animation (3 different stand positions for the legs, trying to match the oldest "run" or "walking" frame as much as possible)
    Simplified code: i added 4 extra bones on the skeleton, they are not animated at all, so instead of reading an existing bone, adding values and rewrite it I can simply overwrite a '0 0 0' bone, saving some calculations.
    the bending animations are subdivided on 4 bones (torso, neck, left arm, right arm) so for both "turning" and "bending" i can give 50% of the movement to each, and it looks very good.
    It will be a pain in the ass to align the arms, the aiming and the weapon ... but I'll cry about that later.

    THE HELP I NEED WITH THE CODE.

    I can't have the custom getstat working (don't bother telling me that there is the code missing, I know, i deleted it because I am trying to keep it clean)
    I lose my own player on CSQC ... as soon as I send the model to CSQC, the POV resets to '0 0 0'.
    Also the supposed code that should allow the client to recognize the very own player doesn't work.
    I used a hack in both cases to regain control.
    Note also that once the model is controlled by the client, is visible by default, the engine doesn't make it "invisible" for you.
    Probably something is wrong with the defs/builtins/constants ... I can't tell.

    If you want to help, please fix the code and paste the fixed/working code here
    If you want to go through the code and grab lines and/or ideas, feel free ... but I suggest everybody to wait a little so we can share a 100% working code to have fun with.

    Download: http://www.diktatorlab.com/CSQCP.zip
    Thanks a lot!

    P.S. sorry I had to overwrite the skins of the model, but that was copyrighted stuff.
    The model sucks anyway, the final version would have also bones for mouth/eyes, maybe fingers, but it would be some very hi-poly for sure.
    Attached Files
    Last edited by ChristianIce; 06-06-2012, 11:29 AM.

  • #2
    Originally posted by ChristianIce
    this is NOT a release meant to be used as a mod in any way (yet).
    I liked the YET part
    Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

    Comment


    • #3
      seems awesome! i will trie to help you !
      the invasion has begun! hide your children, grab the guns, and pack sandwiches.

      syluxman2803

      Comment


      • #4
        Thank you.
        My "educated" guess is that before to even check the code somebody should make sure that the Defs, the constants and the builtins on both the server and the client are up to date and correct.
        I pasted what Lord Havoc included in the last release, but maybe i made some mess there ...

        Comment


        • #5
          Woohoo! Skeletal animations!
          QuakeOne.com
          Quake One Resurrection

          QuakeOne.com/qrack
          Great Quake engine

          Qrack 1.60.1 Ubuntu Guide
          Get Qrack 1.60.1 running in Ubuntu!

          Comment


          • #6
            wow! good stuff man!
            http://www.nextgenquake.com

            Comment


            • #7
              omfg this is sooo awesome! me want!

              i soo totally want this in quake, it always bothered me how stupid it looked in quake when aiming and such,
              and i would love to have this doom3 like aiming and walking in quake <3<3<3<3

              and i hope itll also allow for detaching the quake marine from that uber-lame multi-gun,
              and we'll finally be able to actually see the marine holding the weapon thats selected instead of that lame-ass multi-gun


              oh and also awesome would be able to use custom models like in Q3A <3
              that would rock too, if everyone could use a different player model
              Last edited by talisa; 06-06-2012, 04:16 PM.
              .
              are you curious about what all there is out there in terms of HD content for quake?
              > then make sure to check out my 'definitive' HD replacement content thread! <
              everything that is out there for quake and both mission-packs, compiled into one massive thread

              Comment


              • #8
                Or Make a running without weapon and running with weapon animations where running without a weapon would increase your speed %10, This could be epic!

                Think how better looking enemies and monsters would look if they had animated sectioned skeletal blending!

                Very impressive!
                QuakeOne.com
                Quake One Resurrection

                QuakeOne.com/qrack
                Great Quake engine

                Qrack 1.60.1 Ubuntu Guide
                Get Qrack 1.60.1 running in Ubuntu!

                Comment


                • #9
                  regarding pov/chasecam/etc, check csqctest's q3 player models.
                  set cg_thirdPerson 1; set cg_thirdPersonRange 64
                  will give you a chasecam somewhat similar to what you have already, but implemented the 'expected' way (ie: supposedly without hacks or client-dependant features, though I'm not going to claim to have tested it on dp recently).
                  csqctest already runs prediction clientside, though currently it runs its own qc-based physics which will break on dp. There's some OWNPLAYERPHYSICS define or something that you can disable to skip that feature so it doesn't bug out on DP, which lacks the server-side support for it.
                  your pov issues likely come down to the fact that either the engine knows about your entity, or the csqc does, but not both at the same time (the renderer sees your renderables, but the client/csqc interactions are otherwise minimal).

                  regarding your 4 extra bones. why do you not just call skel_mulbone(s) instead? less work for the engine and no more function calls over your skel_setbone code, assuming you call it after calling skel_build.
                  it looks like you're not blending leg animations together, nor interpolating between, resulting in some ugly jerks.
                  camera movement seems jerky too, but I'm not sure if that's just the video or not.

                  I wrote some code a while ago for some (now dead) mod with electro, with proper foot synchronisation with the ground and stuff. sadly the model it was working with wasn't mine (so I can't distribute that) and the model was made with the expectation of inverse kinematics for firing, which means that its not really usable as-is.
                  foot/ground syncing isn't too hard, but does require that the model has separate animations for the 4 horizontal axial directions with the same duration such that the different axis can be smoothly blended together for 45 degree motion.

                  getstat:
                  getstat is not useful for multiplayer animations. its only useful for _local_ player stuff.
                  note that the csqcscratch mod renames some things weirdly so that EV_FLOAT is remapped to EV_INT, with EV_FLOAT_TRUNCATED being the 'real' ev_float, basically resulting in you needing to use getstati to read such floats. Which makes no sense.
                  this is to work around a limitation that still lingers in DP where ev_float stats are truncated to integer values. If you're using only fte, you should just directly use ev_float because fte will not unconditionally truncate.


                  its nice to see someone else trying to tackle this stuff. personally I kinda stopped bothering on account of not having a non-ik model that I can also freely distribute.
                  Some Game Thing

                  Comment


                  • #10
                    Fu**in A!!!!
                    Last edited by gdiddy62; 06-07-2012, 06:18 AM.

                    Comment


                    • #11
                      Very nice!

                      Comment


                      • #12
                        Spike.
                        I am blending the frames in the only way I can ... i have 10 frames a second animation and somewhat 50 or 60 cicles every second on the client engine, what I did was to set the "nextframe" and then blending the 80% of it on any cicle, and after 5 or 6 times changing to the next frame.
                        Can you post a link of your csqc player, I mean a working zip with an actual model, because what i ve found on the repository doesn't help, after download it it didn't compile.
                        On the other hand, what would REALLY help me is if you could check my actual code and fix that one, not enough documentations is around for csqc yet and it's a mess to trying by guessing.

                        Comment


                        • #13
                          oooh! does this mean we might be getting playermodels that bend at the hip, have jumping anims, maybe even ragdolls?? o_O

                          Comment


                          • #14
                            Originally posted by Spike View Post
                            regarding pov/chasecam/etc, check csqctest's q3 player models.
                            set cg_thirdPerson 1; set cg_thirdPersonRange 64
                            will give you a chasecam somewhat similar to what you have already..
                            What I have now is just a "traceline", it is in a very early stage, i decided to have the proportions and the model finished before going on with the cam, so i will be able to take care of the right aiming, position then I'll add some eyecandy for the killshots, taunting, cinematics and most important I want it to be a way in the middle between 1st and 3rd person view, where the camera anticipates your actions and places itself next to the gun while firing.


                            Originally posted by Spike View Post
                            csqctest already runs prediction clientside, though currently it runs its own qc-based physics which will break on dp.
                            Not a problem, I am using qc physics too.
                            I'll ask your help with the prediction in future, now what I need is to be able to call a "local player" ... the hack I am using is very poor, if you'll go through the code you'll laugh 5 minutes about it

                            Originally posted by Spike View Post
                            your pov issues likely come down to the fact that either the engine knows about your entity, or the csqc does, but not both at the same time.
                            That's weird, the server knows where the entity is, everything works for the entity that moves, touch and dies in lava as it should ...
                            It's just the origin that is lost, while the rest of the info look to be correctly shared.
                            May be it has something to do with my inability to find my "local player"?
                            That's the biggest issue anyway, I really hope somebody will look through the code and tell me what's wrong, I accept to be insulted after that

                            Originally posted by Spike View Post
                            why do you not just call skel_mulbone(s) instead?
                            .
                            I tried everything and I consider myself lucky that at least it works in this way, but by all means, show me what's wrong or what could be done better.

                            Originally posted by Spike View Post
                            foot synchronisation with the ground.
                            I don't really care about that, it would result either in a slow player or a funny walking one ... i'll do it as realistic as possible palying with the physics and the legs framerate, but it's a waste of time to make a foot synchro on player that floats on the air if one pixel touches a higher surface ... it's quake anyway, not a flight simulator


                            Originally posted by Spike View Post
                            getstat:
                            getstat is not useful for multiplayer animations. its only useful for _local_ player stuff..
                            And that's what I need it for, the problem is that I can't have it working!
                            I follow every tutorial, every line on every forum that I've found, but for some reason I can only use the standard quake one, not the additional one that I should be able to use.

                            Originally posted by Spike View Post
                            its nice to see someone else trying to tackle this stuff. personally I kinda stopped bothering on account of not having a non-ik model that I can also freely distribute.
                            Why don't you send me just the skeleton (in SMD), I could apply another model on it, or use another skeleton based on that one with the frames matching and no copyrights issues.
                            Last edited by ChristianIce; 06-07-2012, 08:16 AM.

                            Comment


                            • #15
                              ah, but reading your source requires time, which I'm often not willing to give when I want to go to bed.

                              Right...
                              your .PersID field is redundant.
                              .float entnum; is a system field and will directly match the entity index on the server (ie: you'll never see 0, 1 is the first player, 2 is the second player etc. 33 is the first non-player assuming maxplayers=32(or quakeworld). you're not meant to depend upon this of course, but hey, this is what you'll see). This field is set before CSQC_Ent_Update is called, its the only field the client will explicitly set on such ents.
                              You can then match that self.entnum field to the player_localentnum global in order to give special control to your player's entity.
                              This should avoid the need to use your CLIENT_IDs global and thus remove the need to use stats for your chasecam etc, and also resolve the issue of client_ids wrapping when WriteByte overflows.

                              Regarding your attempt at addstat (ignoring the fact that you shouldn't need it in the first place):
                              void(float num, float type, .void fld) addstat = #232;
                              is called like this: addstat(STAT_CLIENTID/*32+ are what you should be using, not 31*/, EV_WHATEVER/*2=float,8=int*/, PersID);
                              note that there is no 'self.' before PersID, like in the find builtin.
                              The engine monitors the stat fields of all players and sends any updates to those fields automatically, just as it does with stuff like currentammo.
                              Your code would have been more efficient if it had used ev_float=2 instead of ev_int=8, which would have been better even in DP.



                              You should be using the .void() predraw field function instead of using nextent, thus your 'UpdateEveryPlayer()' becomes 'self.predraw = UpdateOnePlayer;' instead, which is cleaner. Its a bit like customizeforclient, think of it as 'customizeforframe'.
                              Its called during R_AddEntities, so its safe to call R_SetView(VF_ORIGIN, foo); in there if you want. This is where csqctest calls its main player prediction function from, for instance.

                              It's just the origin that is lost, while the rest of the info look to be correctly shared.
                              I really don't get what you mean by that.
                              If you mean dp's habit of setting pmove_org then what do you expect when the ent is received by the csqc code _instead_ of the 'legacy' client?
                              pmove_org was not meant to be used by the engine except for within the DefaultPlayerPhysics builtin - same with all the pmove_ globals.

                              Using STAT_WEAPONMODEL is a legacy feature for the local player's viewmodel index. specific values like '64' can theoretically change between maps (can be resolved with modelnameforindex, which can convert it to a string which you can reliably test against), as well as being tied to only the local player, and is thus useless for multiplayer.
                              Some Game Thing

                              Comment

                              Working...
                              X