Page 1 of 1

Hardcoded Models?

Posted: Tue Apr 21, 2009 10:49 pm
by Silicone_Milk
I'm wondering if somebody like Misantropia could answer this question for me:

Any idea why iD Software decided to hardcode all the model files into the game when they had other things data driven?

The only possible reason I could think of is *maybe* it makes dealing with sv_pure easier so people can't just swap models on a whim and still match the checksum of the pak.

Also, what's the deal with storing bad model load requests to prevent hitting the disk again if the player tries to load a non existant model more than once? Seems a bit over the top to me :paranoid:

Re: Hardcoded Models?

Posted: Wed Apr 22, 2009 3:08 pm
by ^misantropia^
Silicone_Milk wrote:Any idea why iD Software decided to hardcode all the model files into the game when they had other things data driven?
You mean the code in cgame/cg_players.c? Probably because it was easier to implement, esp. with regard to fallback (when the model couldn't be found). 'Tis only assumption but developers are lazy creatures and always under deadlines so Occam's razor likely applies here.

Re: Hardcoded Models?

Posted: Wed Apr 22, 2009 9:18 pm
by Silicone_Milk
That was kind of an anticlimatic response :P

I was expecting there to be some little-known C voodoo going on there.

Thanks :)

Re: Hardcoded Models?

Posted: Wed Apr 29, 2009 10:33 pm
by jal_
Maybe cause of precache reasons. When a player model is not precached at loading and a new player connects using it the game freezes for a second to load the model, which is very, very unpleasant for the rest of players in the server. I don't know what code you are refering to, tho.

Re: Hardcoded Models?

Posted: Thu Apr 30, 2009 1:06 am
by Silicone_Milk
The models could still be precached even if you define what models to load through an external file.

It appears iD wasn't too concerned about that though.

Re: Hardcoded Models?

Posted: Thu Apr 30, 2009 9:40 am
by ^misantropia^
Deferred loading? Yes, that's to avoid the hitch when a new player connects. But I thought this was about model paths being hard-coded?

Re: Hardcoded Models?

Posted: Thu Apr 30, 2009 6:22 pm
by Silicone_Milk
^misantropia^ wrote:Deferred loading? Yes, that's to avoid the hitch when a new player connects. But I thought this was about model paths being hard-coded?
It is about hard-coded model paths.