Latest topics
» hammer Game Configurations File
Sun Aug 27, 2017 10:54 am by Admin

» WIP Hammermate
Mon Jul 24, 2017 8:25 pm by Admin

» BSP anti decompiling goldsrc maps
Mon May 15, 2017 8:59 pm by Admin

» yard map a1
Mon May 01, 2017 6:30 pm by Admin

» Get 6 months free pluralsight
Thu Feb 02, 2017 7:08 pm by Admin

» How a skybox can effect your map
Mon Jan 16, 2017 8:52 pm by Admin

» Setup guide for Half-life
Sat Dec 31, 2016 2:19 pm by Admin

» WIP dod_genesis
Sun Sep 25, 2016 12:05 pm by Admin

» [MODEL] V2 rocket
Wed Sep 07, 2016 6:22 pm by Admin

September 2017
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
252627282930 

Calendar Calendar


para_munition_b2

View previous topic View next topic Go down

para_munition_b2

Post by Admin on Sat Jan 23, 2016 1:13 pm

There is a great looking map on 17buddies para_munition_b2 by Ronny (Snut) Klöber, the only problem is its made for 3.1 and no longers works for dod, so I`ll try a few ways to fix this old map and log them here.

http://www.17buddies.net/17b2/View/Map/94275/para_munition_b2.html

When the map is run it crashes with this error

Host_Error: PF_precache_model_I: Model 'sprites/effects/debris_leaf1.spr' failed to precache because the item count is over the 512 limit.
Reduce the number of brush models and/or regular models in the map to correct this.

So first thought is to remove all entities from the map and try again.

Code:
Adding:  dod/dlls\dod.dll
    Dll loaded for mod Day of Defeat
    Spawn Server para_munition_b2
    Clearing memory
    No detail texture mapping file: maps/para_munition_b2_detail.txt
    Texture load:  134.1ms
    WARNING: failed to locate sequence file para_munition_b2
    Building PAS...
    Average leaves visible / audible / total: 165 / 698 / 1858
    "mp_timelimit" changed to "30.000000"
    "mp_flashlight" changed to "1"
    execing skill.cfg

    GAME SKILL LEVEL:1
    Executing listen server config file
    Last 32 messages parsed.
    0 0000 svc_bad
    Wrote erroneous message to buffer.dat
    Host_Error: PF_precache_model_I: Model 'sprites/effects/debris_leaf1.spr' failed to precache because the item count is over the 512 limit.
    Reduce the number of brush models and/or regular models in the map to correct this.
    execing listenserver.cfg
    "pausable" changed to "0"
    "sv_maxspeed" changed to "500"
    "sv_cheats" changed to "0"
    execing para_munition_b2.cfg
    para_munition_b2.cfg loaded



Admin
Admin

Posts : 89
Join date : 2016-01-19

View user profile http://goldsrc.forumotion.co.uk

Back to top Go down

Re: para_munition_b2

Post by Admin on Sat Jan 23, 2016 1:14 pm

Reduce the number of brush models and/or regular models in the map to correct this.

Back when dod got updated from 3.1 a number of maps stopped working dod_cherbourg being one of them, Its a long time ago but I think the cause was that they lowered the number of brush based entities a map could have, looking at the error message the next step is to find the number of brush based entities in the map.

Brush based entites are things like func_wall, ladders and doors.

http://hlbsp.sourceforge.net/index.php?content=bspdef

Looking at above site tells me that the bsp has an index kind of like a book, and that the first thing to do is read the first 4 bytes which should be 30, so next I open a hex editor and see

http://i19.servimg.com/u/f19/18/86/53/45/hex114.png

Yep as the site says the first 4 bytes are the magic number 30.


BSPLUMP lump[HEADER_LUMPS] ok this tells me to expect 16 of these

typedef struct _BSPLUMP
{
int32_t nOffset; // File offset to data (position of the data relative to the start of the file)
int32_t nLength; // Length of data (length of the data relative from the above position)
} BSPLUMP;

one for each of the folowing lumps

#define LUMP_ENTITIES 0
#define LUMP_PLANES 1
#define LUMP_TEXTURES 2
#define LUMP_VERTICES 3
#define LUMP_VISIBILITY 4
#define LUMP_NODES 5
#define LUMP_TEXINFO 6
#define LUMP_FACES 7
#define LUMP_LIGHTING 8
#define LUMP_CLIPNODES 9
#define LUMP_LEAVES 10
#define LUMP_MARKSURFACES 11
#define LUMP_EDGES 12
#define LUMP_SURFEDGES 13
#define LUMP_MODELS 14
#define HEADER_LUMPS 15

ok so the first 4 bytes are the magic number 30, after this is 4 bytes for the LUMP_ENTITIES position (think of this as the starting page number), and then 4 bytes for the LUMP_ENTITIES length (the number of pages)



so reading the bytes 4 - 7 give me 3042768
and bytes 8-11 are 148

so the entity lump starts at 3042768 and is 148 bytes long, simple eh?

Just to check this is correct I`ll jump to position 3042768 and see if the entities are there



Sure enough thats the ENTITIES lump, I just do this 15 more times and we have all the lump positions and lengths.

Admin
Admin

Posts : 89
Join date : 2016-01-19

View user profile http://goldsrc.forumotion.co.uk

Back to top Go down

Re: para_munition_b2

Post by Admin on Sat Jan 23, 2016 1:14 pm

Now it`s easy job to find the position and length of the model lump, there are 14 lumps before the model lump so 14 * 8 bytes (4 for position, 4 length) = 112 now I need to add 4 bytes for the magic number so at byte 116 I have the model lump position.

so I goto 116 in the hex editor and highlight 4 bytes and I get 1624152, the 4 bytes after are 21888

so the model lump starts at byte 1624152, and is 21888 bytes long.

So now I have the lenght if I divide that by the size of a model I get the number of models, so back to the spec

#define MAX_MAP_HULLS 4

typedef struct _BSPMODEL
{
  float nMins[3], nMaxs[3];          // Defines bounding box
  VECTOR3D vOrigin;                  // Coordinates to move the // coordinate system
  int32_t iHeadnodes[MAX_MAP_HULLS]; // Index into nodes array
  int32_t nVisLeafs;                 // ???
  int32_t iFirstFace, nFaces;        // Index and count into faces
} BSPMODEL;

nMins =  3 floats  3 * 4bytes = 12 bytes
nMaxs  =  3 floats  3 * 4bytes = 12 bytes
vOrigin =  3 floats  3 * 4bytes = 12 bytes
iHeadnodes = 4 int32    4  * 4bytes = 16 bytes
nVisLeafs            = 4 bytes
iFirstFace           = 4 bytes
nFaces              = 4 bytes


so a model = 64 bytes  

the lump is 21888 bytes / 64 bytes = 342 brush based models, which is well under the 512 limit.

I`ll just do a quick test, if I edit the length of the model lump to 0, the map should load but all brush entities will be gone



And when i run the map..... nothing

Could be the entities are the casue so I`ll remove them with bspedit and try again.



success the map loads Wink

After playing around 300 models seems to work, and the ones I will remove seem to be only trees, time to package the fixed version up and upload Wink

Admin
Admin

Posts : 89
Join date : 2016-01-19

View user profile http://goldsrc.forumotion.co.uk

Back to top Go down

Re: para_munition_b2

Post by Admin on Sat Jan 23, 2016 1:16 pm


Here it is Wink

http://www.17buddies.net/17b2/View/Map/102882/para_munition_lw.html

Admin
Admin

Posts : 89
Join date : 2016-01-19

View user profile http://goldsrc.forumotion.co.uk

Back to top Go down

Re: para_munition_b2

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum