Announcement

Collapse
No announcement yet.

HEXEN II community work and discussion

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hello Mathuzzz,

    Great news, that you managed to compile your map

    You mentioned that you found fitting Hexen2 models.
    Could you please share the link, where you found them ?
    Because I always search for these kind of models too.
    Thank you.


    Regarding the question to bring new models into H2:
    I am a bloody beginner with .hc
    But I also was playing around with .hc recently and I think I can help you.
    Of course, if Spike can jump in and explain it, it would even be better

    1.) It all starts with calling the models via its specific function in your .bsp:
    Let us follow the procedure with the regular model:
    chair.mdl
    This is how it could look in the mapīs ent file:
    {
    "classname" "obj_chair"
    "origin" "1050 1722 144"
    "scale" "1.4"
    }

    2.) With that, your map calls the specific entity function (in our case the regular chair)
    It is inside object.hc:
    Code:
    void obj_chair()
    {
    	precache_model("models/chair.mdl");
    
    	CreateEntityNew(self,ENT_CHAIR,"models/chair.mdl",chunk_death);
    
    	self.touch	= obj_push;
    	self.flags	= self.flags | FL_PUSH;
    }

    3.) The CreateEntityNew line calls the universal "entity-Spawner" function together with all necessary arguments for that special entity (in your case the chair).
    The function CreateEntityNew is inside spawn.hc


    4.) Inside the universal CreateEntityNew function, the given arguments are used to call the 2 important functions:
    - entity_spawnvalues
    - entity_box

    (both are also inside spawn.hc)
    Several other things are also done, but that is not so important in our case.


    5.) The entity_spawnvalues function contains the necessary values for the chair.
    There are 6 spawn-value fields for each entity !
    The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line (with its given values) for the chair.


    6.) The entity_box function contains the necessary values for the chairīs bbox size.
    There are 2 fields for each entityīs bbox !
    The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line for its values.



    That is the regular precedure from .bsp to in-game spawning of entities.
    If you want to add new entities, you have to create new functions and lines where necessary.

    ATTENTION:
    Hexen 1.11 has theses values for its functions:
    float entity_spawnvalues[456] =
    vector entity_box[152] =
    Hexen 1.12a has theses values for its functions:
    float entity_spawnvalues[552] =
    vector entity_box[184] =
    The mission pack uses more models and needs therefore more values in both spawn functions !
    There is a comment in HC source 1.12a that tells you the formular for these values.
    You MUST modify the values, if you add additional models into your map/hc:

    Formulars are:
    - for entity_spawnvalues: 6 * (float of your highest ENT + 1)
    - for entity_box: 2 * (float of your highest ENT + 1)

    Original Hexen2 uses 75 models + world = 76
    Portals uses 91 models + world = 92


    Example:
    If you want to add 2 new models into original Hexen2, your function must look like this:
    float entity_spawnvalues[468] =
    vector entity_box[156] =
    Dont forget to add the 2 new lines with the models values in both functions.


    Beside the extension of these 2 functions inside spawn.hc, you must also add the specific model functions in object.hc.
    Remember, the one for the chair was: void obj_chair ()
    These new functions for your model will be used/called inside your map (.bsp).
    You have to bring them somehow into your mapping tool (or add it via .ent files is a dirty solution), because the mapping tools doesnt know your new models...


    As mentioned before, I am a bloody beginner with .hc, but I think that is what you need to edit when you want to put new models into your map.

    Cant wait to see some screenshots of your map

    All the best,
    Seven

    Comment


    • Well, thank you for such a helpful reply, Seven

      I mostly did exactly what you wrote except the thing with
      float entity_spawnvalues[552] =
      vector entity_box[184] =
      That may be the problem. I havenīt touched those values.

      I created entity function in object.hc, than I have put the necessary values into spawn.hc, but it came up with the error, something like "expected }, found 200", where 200 is one of the values for the new entity.

      I will look at it tomorrow and post my results.

      About the models.

      There is the known site, Iīm sure you came across
      Untitled Page

      Models are md2, but there are plenty of programs which can easily convert between md2 and mdl.
      There are packs with various models, mostly modern, but there are great egyptian themed models, some dungeon themed and interesting pack with trees/bushes, which I especially find useful.

      In the past I found even better model packs, but I was not able to find them now.

      Also, Heretic 2 had some nice models.

      EDIT: I tried it again today, with modified values, but still same error "spawn.hc(206) : expected }, found 100". I donīt know what else Iīm missing.
      Last edited by Mathuzzz; 07-24-2013, 11:51 AM.

      Comment


      • Hello Mathuzzz,

        Do not worry, you and me and we both together will manage it somehow

        First of all: Thank you for the link. Yes, I knew Sitters page before.
        You maybe want to look here for some more interesting links: click



        Now let us fight this error in your compiler together

        I assume you are using the HC source 1.12a as your base ?
        Please check if you did these points:
        1.) You added your new model _ENTS floats in spawn.hc ?
        Example:
        Right below this line you have to add your new _ENTS floats:
        float ENT_DRAGLION = 91; // this is the last model from portals
        I just tested it and added these as placeholders/samples:
        float ENT_MATHUZZZ = 92;
        float ENT_SEVEN = 93;
        float ENT_QUAKEONE = 94;

        2.) Now the next function you have to edit is:
        float entity_spawnvalues[570] =
        I added only 3 new ENTS, that is why I changes the value from 552 to 570
        Formula is: 6 * (float of your highest ENT + 1) = 6 * (94 + 1) = 570

        2.a)Next is to add the 3 lines at the end of this function
        So, as a placeholder I added 3 identical lines at the end of float entity_spawnvalues:

        This is the last line in original function:
        100, 200, 0, 3, 1, 1 // ENT_DRAGLION
        You MUST edit it to:
        100, 200, 0, 3, 1, 1, // ENT_DRAGLION
        Pay attention to the last "," !
        Now add our 3 new lines:
        100, 200, 0, 3, 1, 1, // ENT_MATHUZZZ
        100, 200, 0, 3, 1, 1, // ENT_SEVEN
        100, 200, 0, 3, 1, 1 // ENT_QUAKEONE
        Pay attention that the very last value has NO ",".

        I think this was the root cause for the error you received when compiling

        3.) Do the same for the function
        vector entity_box[184] =
        We added 3 ENTS in this example, so you would have to change it from "184" to "190"
        Formula is: 2 * (float of your highest ENT + 1) = 2 * (94 + 1) = 190

        3.a) Do not forget to add a "," behind the last original value.
        Then add your 3 new lines and do NOT add a "," after the very last value.


        That is the necessary syntax for these functions.
        I think, now you can compile your new code.
        It compiled for me without errors.

        By the way:
        Do you use the FTEQCC compiler ?

        Please pay attention if the spiders are still killable when using the new progs.dat.
        There seem to be a bug in original Hexen2 that causes this.
        I had this bug, when using a new compiled source 1.12a (without any changes !) with FTEQCC.

        Please do not forget your map screens

        Best wishes,
        Seven

        Comment


        • Nice to see some work on the HeXen front!

          Comment


          • if you are using fteqcc, you should be able to completely omit the array length number within the array definition, on the condition that its initialised.
            it should also accept formulas for the array size so long as each part is a constant (and you're not using -O0), this includes constants specified within enums.

            if you still have compile issues after following seven's advice regarding the comma stuff, stick your code into a pastebin or something and I'm sure someone will take great pleasure in trying to spot the issue before anyone else can.
            Some Game Thing

            Comment


            • Seven, Spike, thank you for your help, you guys are really helpful.

              The problem, of course, was caused, as Seven suggested, by the missing syntax. I have finally compiled my first model. I will post some results later.

              I donīt really know, if I use 1.12a. I use the source from the latest UQE Hexen and from what I know, Portal of Praevus is also the latest version.

              About the models. I found some very interesting models in Razumenīs Ravenhurst. Some really nice reworked models, plus some new ones. Especially interesting were the models of Maulotaur and Reaver from Hexen. I was looking a long time for the model of Reaver. Second Quakeīs mission pack had similar looking monster, but I didnīt like the animations very much. It would be great if Razumen would share these models.

              I will post some screenshots right after I remove some of the rough edges that are left after I erased some of the brushwork.

              Comment


              • Hello Mathuzzz,

                I do not know the source from UQE Hexen2 website.
                All I know is, that Hexen II: Hammer of Thyrion has developed the latest version of portals (which is 1.12a) further. They made a lot of bugfixes. They reached V1.28 now.

                Maybe Korax also further developed the 1.12a gamecode ?

                Anyhow, I am using 1.12a gamecode as my base.
                Be careful that your mod will be engine independent. The rest doesnt matter




                Hello Spike,

                I am using your V1.0 fteqcc (june 2011) and it has several issues with 1.12a code. I would like to take the opportunity to write about it. Maybe you want to take a look and see if you can confirm some of them.
                Foreword: I do not know if the 1.12a source is the *real* source.
                At least the readme.txt claims it to be

                These are the errors fteqcc gives me, when compiling original 1.12a with -h2 extension:

                1.) It cannot handle this code block (in client.qc: void() PutClientInServer =):
                Code:
                				pclass=random(0,5);
                				switch(pclass)
                				{
                					case 0..1:
                						setclass(self,1);
                						break;
                					case 1..2:
                						setclass(self,2);
                						break;
                					case 2..3:
                						setclass(self,3);
                						break;
                					case 3..4:
                						setclass(self,4);
                						break;
                					default:
                						setclass(self,5);
                						break;
                				}
                It doesnt understand these syntax in specific:
                case 0..1
                case 1..2
                case 2..3
                //and so on
                I have to change it to this to make it work:
                Code:
                				pclass=random(0,5);
                				switch(pclass)
                				{
                					if (pclass >= 0 && pclass <= 1)
                						setclass(self,1);
                						break;
                					if (pclass >= 1 && pclass <= 2)
                						setclass(self,2);
                						break;
                					if (pclass >= 2 && pclass <= 3)
                						setclass(self,3);
                						break;
                					if (pclass >= 3 && pclass <= 4)
                						setclass(self,4);
                						break;
                					default:
                						setclass(self,5);
                						break;
                				}



                2.) Similar issue in impulse.qc: at the end of: void() ImpulseCommands =
                Code:
                	switch (self.impulse)
                	{
                	case 1..4:
                		W_ChangeWeapon();
                	break;
                	case 10:
                		if (wp_deselect == 0)
                			CycleWeaponCommand ();
                	break;
                	case 11:
                		ServerflagsCommand ();
                	break;
                	case 12:
                		CycleWeaponReverseCommand ();
                	break;
                	case 13:
                		HeaveHo();
                	break;
                ....
                There is also this strange syntax:
                case 1..4:
                I have to replace it with this to make it compile:
                if (self.impulse >= 1 && self.impulse <= 4)



                3.) Last error is the missing function for
                randomv (vector1, vector2);
                As you know, this randomized vector calculation is used in many places (example: blood particle spawning in chunk.hc). Inside:
                void ThrowBlood (vector org,vector dir)
                you have this line:
                blood.avelocity=randomv('-700 -700 -700','700 700 700');
                A simple function like this (added before void ThrowBlood (vector org,vector dir) ) does the job:
                Code:
                vector(vector m1, vector m2) randomv =
                {
                	local vector v;
                	m2 = m2 - m1;
                	v_x = m2_x * random() + m1_x;
                	v_y = m2_y * random() + m1_y;
                	v_z = m2_z * random() + m1_z;
                	return  v;
                };


                Can you please confirm that you also have these errors when using: fteqcc.exe -h2
                Unfortunately you did not include a GUI version of your V1.0 fteqcc.
                I use an older build for Quake, which has a GUI version. But it doesnt work for Hexen2, so I cannot try other options/settings.


                At the end some more questions for my understanding:
                There is this bug, that I cannot kill spiders anymore, when I compile the unchanged source. Can I do something about it ? Hints ?
                FTEQCC compiles a "progs.dat". But I see that there is also a "progs2.dat" in \data1 folder (it is smaller in size compared to "progs.dat").
                What is this about ?
                In \portals folder there is only 1 "progs.dat" (and no second one).
                But it doesnt matter in which folder I put my compiled "progs.dat", the spider bug is always there.
                I assume that FTEQW uses only the one in \portals folder, when I play with extension:
                fteqw.exe -portals

                Thank you very much for your effort and answer.
                Seven
                Last edited by Seven; 07-25-2013, 12:47 PM.

                Comment


                • Yes, well, I have also HoT source. The thing is, it has fewer hc files, thatīs why I went with UQE source. HoT 1.5.5 hc directory contains 116 files, while UQE hc directory contains 139 files. Is all that code useless/buggy/unfinished?

                  I knew there was plenty of unfinished code, but I thought some of it could be finished/used.

                  Well, the mod will probably require one of the advanced engines and probably will have problems with jsHexen, because that engine doesnīt handle higher poly models well. So UQE, HoT, FTEQW should be without problems. But it is too early to say. Depends on how much time I will have. Maybe I will make 2 versions. One would contain just maps. Second would be with custom stuff.

                  Also, I have one more question. Is it somehow possible to have models with alpha transparency? Because classic .mdl models doesnīt support that
                  Last edited by Mathuzzz; 07-25-2013, 02:08 PM.

                  Comment


                  • @seven:
                    tldr version: grab an 'experimental' build.
                    1.12a is the official PoP release and not a third-party version, yeah? If not, give me a url to test against, but otherwise I'm assuming so...
                    FTEQCC V1.0 is pretty old too... needs a new release really, use experimental builds instead (which do have gui versions available).
                    your points 1+2 are the same: switch counts as a goto, writing random if statements in there without a case (or default) will always result in unreachable code. The svn version of fteqcc has no issues with PoP's various switch statements and case ranges, as far as I can see. I cannot recall any prior issues with case ranges either, but then I'm not sure my memory for such things is that great anyway :s
                    your point 3: randomv is implemented as an intrinsic using special opcodes for h2 (and the random() builtin for qc). it should not matter that its missing.
                    the svn version has neither of those issues, but does have a separate recently created issue with .structs (which is NOT present in the most recent experimental build available)
                    The experimental builds ( Index of /moodles/fteqcc ) seem to compile h2mp code fine, but I'm too lazy to actually run it the output. :s

                    invincible spiders is due to this line in damage.hc:
                    if(targ.camera_time>=time&&!deathmatch)
                    camera_time is a player-specific part of a .union and aliases to the spider's spiderActiveCount field.
                    The conflict between the two results in invincible spiders, if you start attacking spiders too early into the map or something wierd like that.

                    progs2 is part of hexen2's map-specific progs feature. there's some file that says which progs to use for which maps. Basically its a way around hcc limitations at the time, PoP's hcc was extended/rewritten or something that allowed for larger progs and thus the progs2 thing was no longer needed and thus PoP no longer uses it. or something
                    Some Game Thing

                    Comment


                    • Originally posted by Mathuzzz View Post
                      Yes, well, I have also HoT source. The thing is, it has fewer hc files, thatīs why I went with UQE source. HoT 1.5.5 hc directory contains 116 files, while UQE hc directory contains 139 files. Is all that code useless/buggy/unfinished?

                      I knew there was plenty of unfinished code, but I thought some of it could be finished/used.
                      UQE actually ships with a rather older version of uHexen2 hcode. In addition, it keeps the original version under its tools/source/hcode directory, possibly for reference. The missing files you mention are unused files in the progs builds, so I removed them, because it is easier for maintenance: if you want those missing files see them here:
                      http://sf.net/p/uhexen2/code/HEAD/tr...ence/gamecode/

                      As for having uhexen2 1.5.5 sources: please move to 1.5.6 which is the latest.

                      And yes, 1.12a is really the official PoP release from Raven.

                      For your reference, I had generated source code to all known hexen2 progs version for reference, no additional modifications or fixes or anything, but source to Raven's several versions of hexen2/hexenworld progs. See here:
                      http://sf.net/projects/uhexen2/files...hcode_archive/
                      Last edited by szo; 07-26-2013, 12:04 AM.

                      Comment


                      • Thanks for the info szo. Is all the code buggy/unusable? Whether some of it can be implemented in the game.
                        Also, does the Siege mod has some new stuff, absent from the game?

                        Comment


                        • Originally posted by Mathuzzz View Post
                          Thanks for the info szo. Is all the code buggy/unusable? Whether some of it can be implemented in the game.
                          To be honest, I never needed them, nor did I ever attempted to compile them.

                          Originally posted by Mathuzzz View Post
                          Also, does the Siege mod has some new stuff, absent from the game?
                          Siege is a whole different HexenWorld mod (not a Hexen II mod) by Raven, so yes: a lot of stuff from siege is missing in the original hexen2 game.

                          Comment


                          • Hello Mathuzzz, hello szo,

                            Just like szo mentioned, The HoT webpage hosts many different sources.
                            It is a little bit complicated to keep the overview, but I really appreciate it

                            You will find inside the file: hcode_archive.tar.gz the last official sources.
                            Including the complete Hexen2 (v1.11) and Portals (v1.12a)
                            That is important to know, as these sources are the ones we all rely on.

                            You will then find HoTīs updated gamecode in this file: gamedata-src-1.28.tgz
                            This is the version with the bugfixes from HoT (as I mentioned above).
                            You will find original Hexen2 code updated to v1.28 as well as Portals updated to v1.28

                            A long list of change history and what was bugfixed is included.
                            As far as I can see from quickly browsing it, the "invincible spider" bug is not fixed

                            I like the things that has been fixed inside v1.28 and will most probably use it as base.
                            Do not mix it up with the engine version: v1.5.6
                            We are only talking about gamecode (game mechanics) here.

                            You will find both of above mentioned files here: click
                            Then click on the left on "Downloads" and scroll down to Game Data:
                            Here you will find both files (last official sources and updated v1.28 sources)




                            Hello Spike,

                            Thank you for your reply.
                            I downloaded the latest fteqccgui.exe from 2013-03-12.
                            It doesnt show any errors when compiling the latest official Portals v1.12a source
                            So far so good

                            But your engine does not like the compiled "progs.dat"
                            I use fteqw from 2013-07-08 with -portals extension.
                            And this is what I got after starting Portals:

                            1st (you can see it in original size by clicking "Bild in Originalgröße anzeigen" on the webpage)


                            then, after pressing esc:


                            and short time after (windows crash):

                            The desktop brightness was still Hexen2īs and I had to reboot.

                            Is this the issue with .structs you told me ?
                            At the moment I do not have a working fteqcc to compile Hexen2 source




                            Hello szo, hello Mathuzzz

                            I found the source of another Hexen2 compiler: HCC inside HoTīs file: hexen2source-1.5.6.tgz
                            Unfortunately I cannot create the .exe file out of the source.
                            There is a "Makefile" included, but I do not know how to compile the .exe
                            Can someone send me the compiled HCC-compiler for Win32 ?
                            I want to play around with the Hexen code a bit if I have the time and opportunity.

                            Or Mathuzzz,
                            can you send me the compiler you used for UQE source ? Or link me to its download ?


                            Thank you very much.
                            Seven

                            Comment


                            • Originally posted by Seven View Post
                              [...] A long list of change history and what was bugfixed is included.
                              As far as I can see from quickly browsing it, the "invincible spider" bug is not fixed
                              Noted this one. But since we no longer have a dedicated hexenc developer, it may take a long time to fix.

                              Originally posted by Seven View Post
                              Do not mix it up with the engine version: v1.5.6
                              We are only talking about gamecode (game mechanics) here.
                              That's a yes from the hexenc developer's point of view. However, remember that the engine (the original source release itself from Raven) includes tons of bugs that affect gameplay too, and sometimes in severe ways: uHexen2 has fixes for many of them.

                              Originally posted by Seven View Post
                              [...] I found the source of another Hexen2 compiler: HCC inside HoTīs file: hexen2source-1.5.6.tgz
                              Unfortunately I cannot create the .exe file out of the source.
                              There is a "Makefile" included, but I do not know how to compile the .exe
                              Can someone send me the compiled HCC-compiler for Win32 ?
                              I want to play around with the Hexen code a bit if I have the time and opportunity.
                              You can already download the precompiled win32 binaries here:
                              http://sf.net/project/downloading.php?group_id=124987&filename=hexen2-utils-1.5.6-win32.zip
                              ... or the win64 version here:
                              http://sf.net/project/downloading.php?group_id=124987&filename=hexen2-utils-1.5.6-win64.zip

                              Comment


                              • Originally posted by Seven View Post
                                Or Mathuzzz,
                                can you send me the compiler you used for UQE source ? Or link me to its download ?
                                Itīs the compiler included in the latest UQE Hexen 2 version (1.16)
                                There, in the UQE Tools subdirectory, is uqehx2hcc.

                                About the invincible spider bug. I havenīt noticed it, I recompiled several times last days, trying those custom models, then I made test map with all 4 types of spiders, none of them was invincible.

                                Comment

                                Working...
                                X