Re: [hlcoders] Pre-Loading Maps

2013-01-16 Thread Chris Green
Once could imagine getting some map loading speed by getting the map data and 
other resources into the disk cache so that when an actual map-load happens, 
the amount of disk i/o needed is reduced.
So, you wouldn’t tell the engine to do anything with the bsp file to preload 
it.. rather, you’d open the map file and just read all the bytes out of it, 
throwing them away. Then, when the engine later tries to load that map,
chances are that the file operations would be much faster.

This would only reduce the part of the load time which is related to reading 
data from disk, not that part which involves CPU processing of the data loaded. 
But it would probably make your map load time closer to the time you see when 
the map has been loaded before.


From: hlcoders-boun...@list.valvesoftware.com 
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Tom Schumann
Sent: Tuesday, January 15, 2013 1:55 AM
To: Mart-Jan Reeuwijk; Discussion of Half-Life Programming
Subject: Re: [hlcoders] Pre-Loading Maps

I thought that the map was kept in memory after in was loaded by design (I 
don't know for sure though).
I remember it being brought up at some stage - someone wanted that behaviour 
removed so they wouldn't have to restart the game every time they recompiled a 
map.

I'm not sure about preloading materials but I saw this in the Alien Swarm 
source: CBaseEntity::PrecacheModel(sprites/gunsmoke.vmt);
So I suppose the PrecacheModel function should work for materials too.
On 15 January 2013 01:26, Mart-Jan Reeuwijk 
mreeu...@yahoo.commailto:mreeu...@yahoo.com wrote:

Prolly some OS caching after access.

From: tja...@comcast.netmailto:tja...@comcast.net 
tja...@comcast.netmailto:tja...@comcast.net

To: Discussion of Half-Life Programming 
hlcoders@list.valvesoftware.commailto:hlcoders@list.valvesoftware.com
Sent: Monday, 14 January 2013, 14:47

Subject: Re: [hlcoders] Pre-Loading Maps

That's a shame. I did look through zone cpp/h but it might be over my head, 
when it comes to memory allocation.
Also, from what I've heard -heapsize command line doesn't matter anymore with 
orange box. So I'm not sure if that file is still relevant.

Is there any cheap tricks to help performance? I'm bouncing between maps, and 
users are getting frustrated with load times.

I do have a benchmark time that shows how long a map takes to load (grab 
curtime from preload and compare with curtime in postload. not sure how 
accurate) and I noticed if the map has been loaded before it takes half the 
amount of time to load.
So something is staying in the memory.

From: Jonatan Matějka jonatan1...@gmail.commailto:jonatan1...@gmail.com
To: Discussion of Half-Life Programming 
hlcoders@list.valvesoftware.commailto:hlcoders@list.valvesoftware.com
Sent: Monday, January 14, 2013 8:19:43 AM
Subject: Re: [hlcoders] Pre-Loading Maps

Hi,
if there were not significant changes in engine after HL2 alpha leak, there is 
no way to load nextmap before mapchange. You can precache it, but it will be 
trashed on mapchange anyway. If you own leaked source, take a look at 
zone.cpp/h where you can take a look for yourself.
2013/1/14 Trevor Janok tja...@comcast.netmailto:tja...@comcast.net
Hello HLCoders.

I have no idea how Source loads/renders the BSP levels. Since I assume most (if 
not all)  of this is done in the engine which we don’t have access to.
But is there anyway to load a BSP into “memory” so the client can switch maps 
faster?

I mean, if you’re running on decent hardware Source maps load fast. But it 
would be nice to start “preloading” maps when players near completion of the 
current level.
The gameplay of my mod would help greatly from this, as maps are broken up into 
multiple levels running on a master server.

I guess I can’t really assume what it’s “preloading” as I’m not sure of what 
Source is doing when it’s switch to a different map.

Anybody have any insight? Thanks.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-15 Thread Tom Schumann
I thought that the map was kept in memory after in was loaded by design (I
don't know for sure though).
I remember it being brought up at some stage - someone wanted that
behaviour removed so they wouldn't have to restart the game every time they
recompiled a map.

I'm not sure about preloading materials but I saw this in the Alien Swarm
source: CBaseEntity::PrecacheModel(sprites/gunsmoke.vmt);
So I suppose the PrecacheModel function should work for materials too.

On 15 January 2013 01:26, Mart-Jan Reeuwijk mreeu...@yahoo.com wrote:


 Prolly some OS caching after access.

--
 *From:* tja...@comcast.net tja...@comcast.net

 *To:* Discussion of Half-Life Programming hlcoders@list.valvesoftware.com

 *Sent:* Monday, 14 January 2013, 14:47

 *Subject:* Re: [hlcoders] Pre-Loading Maps

 That's a shame. I did look through zone cpp/h but it might be over my
 head, when it comes to memory allocation.
 Also, from what I've heard -heapsize command line doesn't matter anymore
 with orange box. So I'm not sure if that file is still relevant.

 Is there any cheap tricks to help performance? I'm bouncing between maps,
 and users are getting frustrated with load times.

 I do have a benchmark time that shows how long a map takes to load (grab
 curtime from preload and compare with curtime in postload. not sure how
 accurate) and I noticed if the map has been loaded before it takes half the
 amount of time to load.
 So something is staying in the memory.

 --
 *From: *Jonatan Matějka jonatan1...@gmail.com
 *To: *Discussion of Half-Life Programming 
 hlcoders@list.valvesoftware.com
 *Sent: *Monday, January 14, 2013 8:19:43 AM
 *Subject: *Re: [hlcoders] Pre-Loading Maps

 Hi,
 if there were not significant changes in engine after HL2 alpha leak,
 there is no way to load nextmap before mapchange. You can precache it, but
 it will be trashed on mapchange anyway. If you own leaked source, take a
 look at zone.cpp/h where you can take a look for yourself.

 2013/1/14 Trevor Janok tja...@comcast.net

 Hello HLCoders.
 ** **
 I have no idea how Source loads/renders the BSP levels. Since I assume
 most (if not all)  of this is done in the engine which we don’t have access
 to.
 But is there anyway to load a BSP into “memory” so the client can switch
 maps faster? 
 ** **
 I mean, if you’re running on decent hardware Source maps load fast. But it
 would be nice to start “preloading” maps when players near completion of
 the current level.
 The gameplay of my mod would help greatly from this, as maps are broken up
 into multiple levels running on a master server. 
 ** **
 I guess I can’t really assume what it’s “preloading” as I’m not sure of
 what Source is doing when it’s switch to a different map.
 ** **
 Anybody have any insight? Thanks.
  

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders




 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders


 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders




 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-14 Thread tjanok
That's a shame. I did look through zone cpp/h but it might be over my head, 
when it comes to memory allocation. 
Also, from what I've heard -heapsize command line doesn't matter anymore with 
orange box. So I'm not sure if that file is still relevant. 

Is there any cheap tricks to help performance? I'm bouncing between maps, and 
users are getting frustrated with load times. 

I do have a benchmark time that shows how long a map takes to load (grab 
curtime from preload and compare with curtime in postload. not sure how 
accurate) and I noticed if the map has been loaded before it takes half the 
amount of time to load. 
So something is staying in the memory. 

- Original Message -
From: Jonatan Matějka jonatan1...@gmail.com 
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com 
Sent: Monday, January 14, 2013 8:19:43 AM 
Subject: Re: [hlcoders] Pre-Loading Maps 

Hi, 
if there were not significant changes in engine after HL2 alpha leak, there is 
no way to load nextmap before mapchange. You can precache it, but it will be 
trashed on mapchange anyway. If you own leaked source, take a look at 
zone.cpp/h where you can take a look for yourself. 


2013/1/14 Trevor Janok  tja...@comcast.net  






Hello HLCoders. 



I have no idea how Source loads/renders the BSP levels. Since I assume most (if 
not all) of this is done in the engine which we don’t have access to. 

But is there anyway to load a BSP into “memory” so the client can switch maps 
faster? 



I mean, if you’re running on decent hardware Source maps load fast. But it 
would be nice to start “preloading” maps when players near completion of the 
current level. 

The gameplay of my mod would help greatly from this, as maps are broken up into 
multiple levels running on a master server. 



I guess I can’t really assume what it’s “preloading” as I’m not sure of what 
Source is doing when it’s switch to a different map. 



Anybody have any insight? Thanks. 


___ 
To unsubscribe, edit your list preferences, or view the list archives, please 
visit: 
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders 






___ 
To unsubscribe, edit your list preferences, or view the list archives, please 
visit: 
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders 

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-14 Thread Mart-Jan Reeuwijk

Prolly some OS caching after access. 




 From: tja...@comcast.net tja...@comcast.net
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com 
Sent: Monday, 14 January 2013, 14:47
Subject: Re: [hlcoders] Pre-Loading Maps
 

That's a shame. I did look through zone cpp/h but it might be over my head, 
when it comes to memory allocation. 
Also, from what I've heard -heapsize command line doesn't matter anymore with 
orange box. So I'm not sure if that file is still relevant. 

Is there any cheap tricks to help performance? I'm bouncing between maps, and 
users are getting frustrated with load times. 

I do have a benchmark time that shows how long a map takes to load (grab 
curtime from preload and compare with curtime in postload. not sure how 
accurate) and I noticed if the map has been loaded before it takes half the 
amount of time to load.
So something is staying in the memory. 


From: Jonatan Matějka jonatan1...@gmail.com
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com
Sent: Monday, January 14, 2013 8:19:43 AM
Subject: Re: [hlcoders] Pre-Loading Maps

Hi,
if there were not significant changes in engine after HL2 alpha leak, there is 
no way to load nextmap before mapchange. You can precache it, but it will be 
trashed on mapchange anyway. If you own leaked source, take a look at 
zone.cpp/h where you can take a look for yourself.


2013/1/14 Trevor Janok tja...@comcast.net

Hello HLCoders.
 
I have no idea how Source loads/renders the BSP levels. Since I assume most 
(if not all)  of this is done in the engine which we don’t have access to.
But is there anyway to load a BSP into “memory” so the client can switch maps 
faster? 
 
I mean, if you’re running on decent hardware Source maps load fast. But it 
would be nice to start “preloading” maps when players near completion of the 
current level.
The gameplay of my mod would help greatly from this, as maps are broken up 
into multiple levels running on a master server. 
 
I guess I can’t really assume what it’s “preloading” as I’m not sure of what 
Source is doing when it’s switch to a different map.
 
Anybody have any insight? Thanks.
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



[hlcoders] Pre-Loading Maps

2013-01-13 Thread Trevor Janok
Hello HLCoders.

 

I have no idea how Source loads/renders the BSP levels. Since I assume most
(if not all)  of this is done in the engine which we don't have access to.

But is there anyway to load a BSP into memory so the client can switch
maps faster? 

 

I mean, if you're running on decent hardware Source maps load fast. But it
would be nice to start preloading maps when players near completion of the
current level.

The gameplay of my mod would help greatly from this, as maps are broken up
into multiple levels running on a master server. 

 

I guess I can't really assume what it's preloading as I'm not sure of what
Source is doing when it's switch to a different map.

 

Anybody have any insight? Thanks.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-13 Thread Pizza
Interesting.

 

  _  

From: hlcoders-boun...@list.valvesoftware.com
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Trevor Janok
Sent: Sunday, January 13, 2013 6:55 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Pre-Loading Maps

 

Hello HLCoders.

 

I have no idea how Source loads/renders the BSP levels. Since I assume most
(if not all)  of this is done in the engine which we don't have access to.

But is there anyway to load a BSP into memory so the client can switch
maps faster? 

 

I mean, if you're running on decent hardware Source maps load fast. But it
would be nice to start preloading maps when players near completion of the
current level.

The gameplay of my mod would help greatly from this, as maps are broken up
into multiple levels running on a master server. 

 

I guess I can't really assume what it's preloading as I'm not sure of what
Source is doing when it's switch to a different map.

 

Anybody have any insight? Thanks.

 

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-13 Thread Trevor Janok
After looking, you can call PrecacheModel with a preload option.

 

 // Add to the server/client lookup/precache table, the specified
string is given a unique index

 // NOTE: The indices for PrecacheModel are 1 based

 //  a 0 returned from those methods indicates the model or sound
was not correctly precached

 // However, generic and decal are 0 based

 // If preload is specified, the file is loaded into the
server/client's cache memory before level startup, otherwise

 //  it'll only load when actually used (which can cause a disk i/o
hitch if it occurs during play of a level).

 virtual intPrecacheModel( const char *s,
bool preload = false ) = 0;

 virtual intPrecacheSentenceFile( const char
*s, bool preload = false ) = 0;

 virtual intPrecacheDecal( const char *name,
bool preload = false ) = 0;

 virtual intPrecacheGeneric( const char *s,
bool preload = false ) = 0;

 

I can read the raw BSP and find all the models needed, and start precaching
them before the level transitions. 

I'll have to see if it actually saves time when loading the new level.

From: hlcoders-boun...@list.valvesoftware.com
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Pizza
Sent: Sunday, January 13, 2013 7:45 PM
To: 'Discussion of Half-Life Programming'
Subject: Re: [hlcoders] Pre-Loading Maps

 

Interesting.

 

  _  

From: hlcoders-boun...@list.valvesoftware.com
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Trevor Janok
Sent: Sunday, January 13, 2013 6:55 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Pre-Loading Maps

 

Hello HLCoders.

 

I have no idea how Source loads/renders the BSP levels. Since I assume most
(if not all)  of this is done in the engine which we don't have access to.

But is there anyway to load a BSP into memory so the client can switch
maps faster? 

 

I mean, if you're running on decent hardware Source maps load fast. But it
would be nice to start preloading maps when players near completion of the
current level.

The gameplay of my mod would help greatly from this, as maps are broken up
into multiple levels running on a master server. 

 

I guess I can't really assume what it's preloading as I'm not sure of what
Source is doing when it's switch to a different map.

 

Anybody have any insight? Thanks.

 

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-13 Thread Asher Baker
I think it'll still trash everything at the end of the current map.

On Mon, Jan 14, 2013 at 1:16 AM, Trevor Janok tja...@comcast.net wrote:
 After looking, you can call “PrecacheModel” with a preload option.



  // Add to the server/client lookup/precache table, the specified
 string is given a unique index

  // NOTE: The indices for PrecacheModel are 1 based

  //  a 0 returned from those methods indicates the model or sound
 was not correctly precached

  // However, generic and decal are 0 based

  // If preload is specified, the file is loaded into the
 server/client's cache memory before level startup, otherwise

  //  it'll only load when actually used (which can cause a disk i/o
 hitch if it occurs during play of a level).

  virtual intPrecacheModel( const char *s,
 bool preload = false ) = 0;

  virtual intPrecacheSentenceFile( const char
 *s, bool preload = false ) = 0;

  virtual intPrecacheDecal( const char *name,
 bool preload = false ) = 0;

  virtual intPrecacheGeneric( const char *s,
 bool preload = false ) = 0;



 I can read the raw BSP and find all the models needed, and start precaching
 them before the level transitions.

 I’ll have to see if it actually saves time when loading the new level.

 From: hlcoders-boun...@list.valvesoftware.com
 [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Pizza
 Sent: Sunday, January 13, 2013 7:45 PM
 To: 'Discussion of Half-Life Programming'
 Subject: Re: [hlcoders] Pre-Loading Maps



 Interesting.



 

 From: hlcoders-boun...@list.valvesoftware.com
 [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Trevor Janok
 Sent: Sunday, January 13, 2013 6:55 PM
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] Pre-Loading Maps



 Hello HLCoders.



 I have no idea how Source loads/renders the BSP levels. Since I assume most
 (if not all)  of this is done in the engine which we don’t have access to.

 But is there anyway to load a BSP into “memory” so the client can switch
 maps faster?



 I mean, if you’re running on decent hardware Source maps load fast. But it
 would be nice to start “preloading” maps when players near completion of the
 current level.

 The gameplay of my mod would help greatly from this, as maps are broken up
 into multiple levels running on a master server.



 I guess I can’t really assume what it’s “preloading” as I’m not sure of what
 Source is doing when it’s switch to a different map.



 Anybody have any insight? Thanks.




 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



Re: [hlcoders] Pre-Loading Maps

2013-01-13 Thread Trevor Janok
Awesome info.

 

How exactly would you go about preloading materials/textures?

 

From: hlcoders-boun...@list.valvesoftware.com 
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Adam amckern 
McKern
Sent: Sunday, January 13, 2013 9:10 PM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] Pre-Loading Maps

 

The longest part about loading levels is all the assets that get rendered on 
top of the brush work. You could have a set texture set, and ensure that this 
texture set is loaded every time the game is loaded in an example, you could 
have say 2,000 brushes in your back ground menu map, and each brush has a 
texture from your asset list - this will help improve loading times - only down 
side of this could be your heap size would need to be bigger, and if people are 
joining the game from the server browser, they will bypass this background menu 
map.

 


Owner Nigredo Studios http://www.nigredostudios.com 
http://www.nigredostudios.com/ 

  _  

From: Asher Baker asher...@gmail.com
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com 
Sent: Monday, 14 January 2013 12:57 PM
Subject: Re: [hlcoders] Pre-Loading Maps


I think it'll still trash everything at the end of the current map.

On Mon, Jan 14, 2013 at 1:16 AM, Trevor Janok tja...@comcast.net wrote:
 After looking, you can call “PrecacheModel” with a preload option.



  // Add to the server/client lookup/precache table, the specified
 string is given a unique index

  // NOTE: The indices for PrecacheModel are 1 based

  //  a 0 returned from those methods indicates the model or sound
 was not correctly precached

  // However, generic and decal are 0 based

  // If preload is specified, the file is loaded into the
 server/client's cache memory before level startup, otherwise

  //  it'll only load when actually used (which can cause a disk i/o
 hitch if it occurs during play of a level).

  virtual intPrecacheModel( const char *s,
 bool preload = false ) = 0;

  virtual intPrecacheSentenceFile( const char
 *s, bool preload = false ) = 0;

  virtual intPrecacheDecal( const char *name,
 bool preload = false ) = 0;

  virtual intPrecacheGeneric( const char *s,
 bool preload = false ) = 0;



 I can read the raw BSP and find all the models needed, and start precaching
 them before the level transitions.

 I’ll have to see if it actually saves time when loading the new level.

 From: hlcoders-boun...@list.valvesoftware.com
 [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Pizza
 Sent: Sunday, January 13, 2013 7:45 PM
 To: 'Discussion of Half-Life Programming'
 Subject: Re: [hlcoders] Pre-Loading Maps



 Interesting.



 

 From: hlcoders-boun...@list.valvesoftware.com
 [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Trevor Janok
 Sent: Sunday, January 13, 2013 6:55 PM
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] Pre-Loading Maps



 Hello HLCoders.



 I have no idea how Source loads/renders the BSP levels. Since I assume most
 (if not all)  of this is done in the engine which we don’t have access to.

 But is there anyway to load a BSP into “memory” so the client can switch
 maps faster?



 I mean, if you’re running on decent hardware Source maps load fast. But it
 would be nice to start “preloading” maps when players near completion of the
 current level.

 The gameplay of my mod would help greatly from this, as maps are broken up
 into multiple levels running on a master server.



 I guess I can’t really assume what it’s “preloading” as I’m not sure of what
 Source is doing when it’s switch to a different map.



 Anybody have any insight? Thanks.




 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders