Duke4.net Forums: Can I specify textures to be cached on level loading? - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can I specify textures to be cached on level loading?

#1

A few months ago I posted about an issue with my ATI graphics card and how ever since I bought it 1 year ago, EDuke32 has refused under any circumstances to write textures to the cache. I understood that the issue appears to be very much in the air until who knows when.

The main problem I have with textures not being written to the cache is choking on first-time textures. EDuke32 is set to preload map textures into memory as the level is loaded the first time, and this in theory would result in the game moving smoothly. The reality is far different. The reason for this is that not everything needed is loaded.

Weapons, blood splashes, corpse textures, bullet marks, explosion marks, projectiles, explosion and shrinker/expander effects, teleporter effects, gore, debris, surveillance camera overlay, bulletcases, elements present only on weapon reload animations, cracked windows, models of all enemies frozen, models of all enemies and hidden text under night vision effect, textures for destroyed items and possibly a lot more, are all NOT loaded when the map loads. The result is that the first time you see something new, it stutters. Everytime you shoot a new enemy or kill it, it stutters. Everytime you change to a new weapon, freeze an enemy for the first time, use a switch, etc etc etc it stutters. And it is very, very disruptive. Gradually this stuff is cached and the game stutters less and less, until you quit. And the next time you launch it, this starts all over again.

Back when the texture cache worked, these things would only stutter once, as they were cached for the first time, and never stutter again. So I'd like to know: do I have any place where I can put a script to be executed at the loading of each level that would also cache all these categories of textures into video memory? Since the cache will not work for quite some time, this is the next best solution I have. And I really wanna play Duke. :P

This post has been edited by Searinox Navras: 06 December 2012 - 11:47 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2

Actually that's a very good request. There should be a command to force a set of tiles to be loaded.

This post has been edited by Fox: 06 December 2012 - 12:20 PM

0

User is offline   Darkus 

#3

You can still use the precache command script.

When I use the HRP, I always use a modified EDUKE.CON that precache all needed textures:
// Duke
precache
1400 1543 1
precache
1780 1799 1

// HUD Weapons
precache
1640 1640 1 // Fist
precache
2521 2522 1 // Mighty kick
precache
2564 2565 1 // Hand releasing Keycard/Tripbomb
precache
2568 2568 1 // Hand holding Keycard
precache
2576 2577 1 // Tip hand
precache
2581 2581 1 // Scuba gear

// Monsters
precache
1975 1991 0 // Pigcop Tank
precache
2370 2377 0 // Green Slime
precache
2710 2758 0 // Cycloid
precache
2760 2809 0 // Overlord

// Objects
precache
130 131 0 // Keycard lock 1
precache
132 133 0 // Slot Door
precache
134 135 0 // Light Switch
precache
136 137 0 // Space Door Switch
precache
138 139 0 // Space Light Switch
precache
140 141 0 // Frankie Switch
precache
162 163 0 // Dip Switch 1
precache
164 165 0 // Dip Switch 2
precache
166 167 0 // Tech Switch
precache
168 169 0 // Dip Switch 3
precache
170 171 0 // Keycard lock 2
precache
595 596 0 // Breakable grate
precache
616 617 0 // Pipe 2
precache
860 861 0 // Power Switch 1
precache
862 863 0 // Lock Switch 1
precache
864 865 0 // Power Switch 2
precache
1111 1112 0 // Hand Switch
precache
1113 1114 0 // Breakable circle panel
precache
1122 1123 0 // Pull Switch
precache
1142 1143 0 // Alien Switch
precache
4397 4398 0 // Speaker

// Effects
precache
550 550 1 // Foot print
precache
634 637 0 // Lightning Bolt
precache
672 674 1 // Foot prints
precache
1226 1226 1 // Blood pool
precache
2219 2239 1 // Explosion bottom
precache
2296 2299 1 // Blood splat
precache
2390 2418 1 // Debris Scrap
precache
4525 4528 0 // Side Lightning Bolt
precache
4890 4890 0 // Natural lightning

include GAME
.CON


However, I have not precached all for some reason: some tiles are reversed, like the tile 342 (breakable pannel) and the 'precache 342 341 0' command don't work;
or there are several tiles between the original sprite and the broken sprite (like the clock, tile 1060, and the broken one, tile 1067) that need to make some maybe 'unused in map' tiles precached.
1

User is offline   blizzart 

#4

View PostDarkus, on 06 December 2012 - 12:34 PM, said:

You can still use the precache command script.

When I use the HRP, I always use a modified EDUKE.CON that precache all needed textures:
// Duke
precache
1400 1543 1
precache
1780 1799 1

// HUD Weapons
precache
1640 1640 1 // Fist
precache
2521 2522 1 // Mighty kick
precache
2564 2565 1 // Hand releasing Keycard/Tripbomb
precache
2568 2568 1 // Hand holding Keycard
precache
2576 2577 1 // Tip hand
precache
2581 2581 1 // Scuba gear

// Monsters
precache
1975 1991 0 // Pigcop Tank
precache
2370 2377 0 // Green Slime
precache
2710 2758 0 // Cycloid
precache
2760 2809 0 // Overlord

// Objects
precache
130 131 0 // Keycard lock 1
precache
132 133 0 // Slot Door
precache
134 135 0 // Light Switch
precache
136 137 0 // Space Door Switch
precache
138 139 0 // Space Light Switch
precache
140 141 0 // Frankie Switch
precache
162 163 0 // Dip Switch 1
precache
164 165 0 // Dip Switch 2
precache
166 167 0 // Tech Switch
precache
168 169 0 // Dip Switch 3
precache
170 171 0 // Keycard lock 2
precache
595 596 0 // Breakable grate
precache
616 617 0 // Pipe 2
precache
860 861 0 // Power Switch 1
precache
862 863 0 // Lock Switch 1
precache
864 865 0 // Power Switch 2
precache
1111 1112 0 // Hand Switch
precache
1113 1114 0 // Breakable circle panel
precache
1122 1123 0 // Pull Switch
precache
1142 1143 0 // Alien Switch
precache
4397 4398 0 // Speaker

// Effects
precache
550 550 1 // Foot print
precache
634 637 0 // Lightning Bolt
precache
672 674 1 // Foot prints
precache
1226 1226 1 // Blood pool
precache
2219 2239 1 // Explosion bottom
precache
2296 2299 1 // Blood splat
precache
2390 2418 1 // Debris Scrap
precache
4525 4528 0 // Side Lightning Bolt
precache
4890 4890 0 // Natural lightning

include GAME
.CON


However, I have not precached all for some reason: some tiles are reversed, like the tile 342 (breakable pannel) and the 'precache 342 341 0' command don't work;
or there are several tiles between the original sprite and the broken sprite (like the clock, tile 1060, and the broken one, tile 1067) that need to make some maybe 'unused in map' tiles precached.


I didn´t know about this script, thanks Darkus. Actually I never cared about the texture caching at all. I just break up the caching on map loading by hitting the SPACE key and everything is still running smoothly on my PC. But with players of my mod with lower systems in mind this script will be very useful.
0

#5

Darkus this is very useful! Still, I get a bit of stuttering at the beginning when killing assault commander, switching to shrinker/expander and freezethrower and when looking to the left on E1M1 towards the cinema entrance just as you fall down the vent. Any idea what might be missing? The script's very good though. There's very little stutter left.

Another source of lag is from the night vision goggles, and it's worse that it doesn't go away after first activation. The reason is that HUD elements, which may vary, are precached only when the goggles change their tint. And since the numbers and icons on the HUD differ when you change weapons/items, there's new ones to precache every time. To be honest the HUD should no longer be affected by the goggles at all. The coding has changed. Game textures are now greenlit using lighting effects and no longer by a single, crude tint affecting the entire screen palette. The new nightvision coding seems to be pretty much complete, so I'd say they can safely deactivate HUD tint.

EDIT: I should probably mention I'm using DukePlus, so some of my texture IDs may be different. For example the battlelord machinegun isn't precached at all and I've no idea how to find its model to add it to the script. Could you also recommend a stable EDuke32 SVN? The latest build runs successfully only a third of the time, the other two thirds either freezing with a gray screen or popping up a small white square in the top left.

This post has been edited by Searinox Navras: 07 December 2012 - 03:47 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

StatCounter - Free Web Tracker and Counter