Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Ergebnis 1 bis 12 von 12
  1. Beiträge anzeigen #1 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.471
     
    lali ist offline

    Too many Alpha Polys in Gothic 1

    Nach meinen letzten Infos kann das in Gothic 2 einfach gelöst werden. Gibt es aber mittlerweile irgendeine Lösung für Gothic 1?
    Phoenix Dev | Website | Discord

  2. Beiträge anzeigen #2 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    I would suggest just optimize your assets. I mean, silencing error is only part of solution. The warning is there for a reason.
    Spells / Unnecessary dense vegetation often cause this. Both of which can be and should be optimized...

    (sorry for no solution, code should be in Icarus thread, because this "feature" originates from polish g1 modder orcwarrior). Look at his posts.

    Edit: found it

    Code:
    func void I_TurnOffWarnMessages()
    {
    		//Adding this function only to release verios is a good idea
    		//Even if you don#msg131941t see warning game still be runing on low
    		//framerates when there is to many alpha polys etc.
    		//Platform: Gothic 1 1.08k mod
    		//Function should be runned at least every time game was inited
    		//f.e: Add it to your Init_AllWorlds function
    
    		//alphablendpoly: Too many alphapolys		
    		MEM_WriteInt(9608588,1);
    		//zCPoligon:ClipToPlane Too many cliped verts!
    		MEM_WriteInt(9127248,1);	
    		//???: Too many alpha world polys!
    		MEM_WriteInt(9234732,1);	
    		
    };
    Geändert von Mark56 (21.10.2019 um 14:39 Uhr)

  3. Beiträge anzeigen #3 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.471
     
    lali ist offline
    Hey Mark again.
    You're right, I should fix what is causing the problem. I thought there could be an easy workaround, but optimization is always preferred. In this case, luckily, I know exactly what is causing the error, its the original pfx effect that was used at the "waste" items at the outside walls of the OC castle, maybe PB decided to ditch it because they didn't have time to fix it or something. It's ridiculously "long" and could be much shorter, but I have never worked with pfx effects, so I'll need to find out how to change this.
    Phoenix Dev | Website | Discord

  4. Beiträge anzeigen #4 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    Yes, its usually badly scripted pfx. If you want advice, use this tool. It lacks some mesh shape rendering, but should work in most cases.

    If effect is very long, usual fix is to make particle "life" shorter. Because as new particles are spawned, they accumulate very fast.
    DOPA PARTER shows you number of polys for rendered effect, so that should give you idea...

    Also here is list of supported values and their meaning.

  5. Beiträge anzeigen #5 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.471
     
    lali ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    Yes, its usually badly scripted pfx. If you want advice, use this tool. It lacks some mesh shape rendering, but should work in most cases.

    If effect is very long, usual fix is to make particle "life" shorter. Because as new particles are spawned, they accumulate very fast.
    DOPA PARTER shows you number of polys for rendered effect, so that should give you idea...

    Also here is list of supported values and their meaning.
    With "long" I did not meant the duration of the effect but I meant that the effect ist very long in its scaling. It needs to go from the OC_LOB_WASTER (or whatever the mesh is called) to the floor, but it goes five or more times as long under the ground, very strange. So I just would need to make that smaller, but I guess then the pfx isn't pretty anymore. Therefore I will look into your links, thanks again!
    Phoenix Dev | Website | Discord

  6. Beiträge anzeigen #6 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    ...
    Spells / Unnecessary dense vegetation often cause this. Both of which can be and should be optimized ...
    [/CODE]
    I strongly disagree with your suggestion to 'optimize' density of vegetation - why should modders limit number of visible vobs (correct me if I am wrong - my understanding of this error is that it pops up when there is too many vobs in view) if there is a possibility to increase this limit? Sektenspinner managed to do that for G2A, so question is how do we achieve same effect with G1?
    https://forum.worldofplayers.de/foru...1#post16945562

  7. Beiträge anzeigen #7 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    We do not understand each other. I am not saying he should make it look worse. Just more appropriate for platform. Also it's entirely possible that G1 capacity to handle alpha vobs is very strict. When creating mod, you have to accept platform limitation to some extent. As I see it, modders often mindlessly go into extremes, thinking more is better. Opposite is often true. This often leads to aesthetic "horror". Not speaking only about models, this includes textures, amount of vobs, effects, anything. There is nothing wrong with optimization itself.

    Lifting that limitation is sure nice thing, but before lifting it, you should ask yourself if your assets are not just too much for such old game. Its renderer was clearly not programmed for today's graphics...
    Also the issue is strictly about alpha vobs, which is often result of particle effects, as they spawn them in hundreds per effect.

  8. Beiträge anzeigen #8 Zitieren
    Provinzheld
    Registriert seit
    Mar 2010
    Ort
    Berlin
    Beiträge
    201
     
    withmorten ist offline
    The alpha polys are limited by an integer value, that can easily be patched (and has been patched in some mods), even in Gothic 1. On modern systems there really is no problem adding more than originally intended.

    I know that there are scripts that increase the alpha poly and vob count for G2. One could probably modify that to work for G1.

  9. Beiträge anzeigen #9 Zitieren
    Schwertmeister
    Registriert seit
    Oct 2015
    Beiträge
    931
     
    Woozel ist offline
    Hasn't Gothic Reloaded Mod (Demo) patched that for example. Or do I remember it wrongly?
    Geändert von Woozel (26.10.2019 um 20:30 Uhr)

  10. Beiträge anzeigen #10 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.471
     
    lali ist offline
    Concerning the GRM I think that was the polygon limitation?
    Phoenix Dev | Website | Discord

  11. Beiträge anzeigen #11 Zitieren
    Provinzheld
    Registriert seit
    Mar 2010
    Ort
    Berlin
    Beiträge
    201
     
    withmorten ist offline
    Vertices limitation (unsigned short max) for the binary format stored on disk. The game can handle it fine.

    Interstingly enough the limit was first also in the in memory format, but that got increased to unsigned int - somebody propably overlooked the binary disk format, not knowing it would have to be changed there also. A nonsensical union of (int, int), (int) in the Vertex struct also remains - that used to be (short, short), (int) ... which makes sense, since the size of the two "elements" should be the same ... whoever edited the vertex limit to int, overlooked that, too

  12. Beiträge anzeigen #12 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline

    MoreAlphaVobs & MoreAlphaPolys compatible with G1

    Hello everyone
    I've been testing this for a while now ... and it seems to be working reliably, so here I am sharing in case anyone else is also stuck with G1 - both functions should be now compatible with G1 / G2 NoTR
    Code:
    /*
    *    MoreAlphaPolys & MoreAlphaVobs
    *    Author: sektenspinner
    *    Original post: https://forum.worldofplayers.de/forum/threads/1039918-Skript-Mehr-Alpha-Vobs-und-Alpha-Polys-in-Gothic-2
    *
    *    Modification: added support for G1.
    */
    
    //************************************************
    //   Alpha-Vob Fix
    //************************************************
    
    func void MoreAlphaVobs(var int newCount) {
        MEM_InitAll();
    
        /* This is an alpha vob:
    
        class zCRndAlphaSortObject_Vob {
            var int _vtbl;
            var int nextSortObject; //zCRndAlphaSortObject_Vob*
            var int zvalue;         //zREAL
            var int vob;            //zCVob*
            var int alpha;          //zREAL
        };
        */
    
        //-->
        //Same size for both G1 & G2
        const int sizeOf_zCRndAlphaSortObject_Vob_G1 = 20;
        const int sizeOf_zCRndAlphaSortObject_Vob_G2 = 20;
    
        //0x007D3994 const zCRndAlphaSortObject_Vob::`vftable'
        const int zCRndAlphaSortObject_Vob__vtbl_G1 = 8206740;
    
        //0x00831BA4 const zCRndAlphaSortObject_Vob::`vftable'
        const int zCRndAlphaSortObject_Vob__vtbl_G2 = 8592292;
    
        var int sizeOf_zCRndAlphaSortObject_Vob; sizeOf_zCRndAlphaSortObject_Vob = MEMINT_SwitchG1G2 (sizeOf_zCRndAlphaSortObject_Vob_G1, sizeOf_zCRndAlphaSortObject_Vob_G2);
        var int zCRndAlphaSortObject_Vob__vtbl; zCRndAlphaSortObject_Vob__vtbl = MEMINT_SwitchG1G2 (zCRndAlphaSortObject_Vob__vtbl_G1, zCRndAlphaSortObject_Vob__vtbl_G2);
        //<--
    
        const int newAlphaVobPool = 0; //wird jedes Laden zurückgesetzt
    
        //nur fixen wenn noch nicht gefixt.
        if (!newAlphaVobPool) {
            //neuer Pool der angegebenen Größe
            newAlphaVobPool = MEM_Alloc(sizeOf_zCRndAlphaSortObject_Vob * newCount);
    
            //Neue Liste bauen, dabei _vtbl und vob initialsieren.
            var int i; i = 0;
            var int loop; loop = MEM_StackPos.position;
            if (i < newCount) {
                var int theSortObj; theSortObj = newAlphaVobPool + i * sizeOf_zCRndAlphaSortObject_Vob;
                MEM_WriteInt(theSortObj +  0, zCRndAlphaSortObject_Vob__vtbl);
                MEM_WriteInt(theSortObj + 12, 0);
                i += 1;
                MEM_StackPos.position = loop;
            };
    
            //Vergleichsinstruktion:
            //0x0051A7E0 5351392 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G1
            //        0051a9cf 3d  00  01       CMP        EAX ,0x100
            //                 00  00
            //0x0051A9D0
    
    
            //0x0052D0A0 5427360 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G2A
            //        0052d28c 3d  00  01       CMP        EAX ,0x100
            //                00  00
            //0x0052D28D
    
            var int ptr; ptr = MEMINT_SwitchG1G2 (5351888, 5427853);
            MemoryProtectionOverride(ptr, 4);
            MEM_WriteInt(ptr, newCount);
    
            //Der Indexzugriff
            //0x0051A7E0 5351392 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G1
            //        0051aa3b 8d  3c  95       LEA        EDI ,[EDX *0x4  + zCRndAlphaSortObject_Vob::s_alp  = NaP
            //                 58  fc  86  00
            //0x0051AA3E
    
            //0x0052D0A0 5427360 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G2A
            //        0052d308 8d  3c  95       LEA        EDI ,[EDX *0x4  + zCRndAlphaSortObject_Vob::s_alp  = NaP
            //                 40  4a  8d  00
            //0x0052D30B
    
            ptr = MEMINT_SwitchG1G2 (5351998, 5427979);
            MemoryProtectionOverride(ptr, 4);
            MEM_WriteInt(ptr, newAlphaVobPool);
    
            //Verschobener Indexzugriff
            //0x0051A7E0 5351392 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G1
            //        0051aa34 8b  0c  95       MOV        this ,dword ptr [EDX *0x4  + DAT_0086fc64 ]         = ??
            //                 64  fc  86  00
            //0x0051AA37
    
            //0x0052D0A0 5427360 private: void __thiscall zCBspTree::RenderVobList(void)
    
            //G2A
            //                0052d301 8b  0c  95       MOV        this ,dword ptr [EDX *0x4  + DAT_008d4a4c ]         = ??
            //                 4c  4a  8d  00
            //0x0052D304
    
            ptr = MEMINT_SwitchG1G2 (5351991, 5427972); //0x52D304
            MemoryProtectionOverride(ptr, 4);
            MEM_WriteInt(ptr, newAlphaVobPool + 12);
        };
    };
    
    //************************************************
    //   Alpha-Poly Fix
    //************************************************
    
    func void MoreAlphaPolys(var int newCount) {
        MEM_InitAll();
    
        //-->
        const int sizeOf_zD3D_alphaPoly_G1 = 256;
    
        const int sizeOf_zD3D_alphaPoly_G2 = 260; //die Teile sind recht groß! Man kriegt nur 4000 pro MB
    
        //0x007DF230 const zD3D_alphaPoly::`vftable'
        const int zD3D_alphaPoly__vtbl_G1 = 8254000;
    
        //0x0083B404 const zD3D_alphaPoly::`vftable'
        const int zD3D_alphaPoly__vtbl_G2 = 8631300;
        //<--
    
        var int sizeOf_zD3D_alphaPoly; sizeOf_zD3D_alphaPoly = MEMINT_SwitchG1G2 (sizeOf_zD3D_alphaPoly_G1, sizeOf_zD3D_alphaPoly_G2);
        var int zD3D_alphaPoly__vtbl; zD3D_alphaPoly__vtbl = MEMINT_SwitchG1G2 (zD3D_alphaPoly__vtbl_G1, zD3D_alphaPoly__vtbl_G2);
    
        //nur anlegen wenn noch nicht geschehen.
        const int newAlphaPolyPool = 0;
        if (!newAlphaPolyPool) {
            newAlphaPolyPool = MEM_Alloc(sizeOf_zD3D_alphaPoly * newCount);
    
            //Neue Liste bauen (vtbl initialisieren).
            //-->
            var int i; i = 0;
            var int loop; loop = MEM_StackPos.position;
            if (i < newCount) {
                MEM_WriteInt(newAlphaPolyPool + i * sizeOf_zD3D_alphaPoly, zD3D_alphaPoly__vtbl);
                i += 1;
                MEM_StackPos.position = loop;
            };
    
            //Den Vergleich fixen:
            //G1
            //0x00716320 private: void __thiscall zCRnd_D3D::XD3D_AlphaBlendPoly(class zCPolygon *,class zCMaterial *)
            //        00716341 3d  00  08       CMP        EAX ,0x800
            //                 00  00
            //0x00716342
    
            //G2A
            //0x0064C960 private: void __thiscall zCRnd_D3D::XD3D_AlphaBlendPoly(class zCPolygon *,class zCMaterial *)
    
            //        0064c982 81  fb  d4       CMP        EBX ,0x6d4
            //                 06  00  00
            //0x0064C984
    
            var int ptr; ptr = MEMINT_SwitchG1G2 (7430978, 6605188);
            MemoryProtectionOverride(ptr, 4);
            MEM_WriteInt(ptr, newCount - 300); //warning-level (ab hier werden keine neuen Vobs angenommen).
            //<--
    
            //Noch ein Vergleich
            //G1 does not have this check
            if (MEMINT_SwitchG1G2 (0, 1)) {
                ptr = 6605201; //0x64C991
                MemoryProtectionOverride(ptr, 4);
                MEM_WriteInt(ptr, newCount); //limit (ab hier: Fehlermeldung)
            };
    
            //Fix XD3D_AlphaBlendPoly
            //-->
            //G1
            //        007163f5 8d  84  30       LEA        EAX ,[EAX  + ESI *0x1  + 0xa18 ]
            //                 18  0a  00  00
    
            //lea eax, [eax + newAlphaPolyPool]
            //lea eax, [eax] 8D 80
            //(figured out this opcode thanks to http://ref.x86asm.net/coder32.html)
    
            //G2A
            //0x0064C960 private: void __thiscall zCRnd_D3D::XD3D_AlphaBlendPoly(class zCPolygon *,class zCMaterial *)
            //        0064ca5b 8d  9c  33       LEA        EBX ,[EBX  + ESI *0x1  + 0xa24 ]
            //                 24  0a  00  00
    
            //lea ebx, [ebx + newAlphaPolyPool]
            //lea ebx, [ebx] 8D 9B
    
            if (MEMINT_SwitchG1G2 (1, 0)) {
                ptr = 7431157; //0x007163F5
    
                MemoryProtectionOverride(ptr, 7);
                MEM_WriteByte(ptr, 141); ptr += 1; //0x8D
                MEM_WriteByte(ptr, 128); ptr += 1; //0x80
                MEM_WriteInt(ptr, newAlphaPolyPool); ptr += 4;
                MEM_WriteByte(ptr, 144); //0x90 = nop
            } else {
                ptr = 6605403; //0x064CA5B
    
                //lea ebx, [ebx + newAlphaPolyPool]
                MemoryProtectionOverride(ptr, 7);
                MEM_WriteByte(ptr, 141); ptr += 1; //0x8D
                MEM_WriteByte(ptr, 155); ptr += 1; //0x9B
                MEM_WriteInt(ptr, newAlphaPolyPool); ptr += 4;
                MEM_WriteByte(ptr, 144); //0x90 = nop
            };
            //<--
    
            //Fix AddAlphaPoly
            //G1 does not have this function
            if (MEMINT_SwitchG1G2 (0, 1)) {
                ptr = 6607092; //0x064D0F4
                //lea ebx, [edx+newAlphaPolyPool
                MemoryProtectionOverride(ptr, 7);
                MEM_WriteByte(ptr, 141); ptr += 1; //0x8D
                MEM_WriteByte(ptr, 154); ptr += 1; //0x9A
                MEM_WriteInt(ptr, newAlphaPolyPool); ptr += 4;
                MEM_WriteByte(ptr, 144); //0x90 = nop
            };
        };
    };

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide