Saints Row: The Third Mission-only content in freeroam gameplay

Hello, Volition!

First of all, thank you very much for provided support :)

Here's a thing that's been keeping me (and other modders as well) on toes for months: we've been trying to allow players use mission-specific weapons - like Murderbrawl's tiki-torches or Hangar 18 1/2 laser guns - in a freeroam gameplay. The problem is that we simply can't find a way to make those weapons' respective meshes, sounds or VFX show up. Is there any way to preload those assets to open-world memory pool?

Thanks in advance!
 
A little memory primer:
We generally use various mempools in order to segment off things for organizational and limit respecting reasons. We have some pools that are similar to malloc, but don't really support free because they grow sequentially and fragmentation is a killer. We use these for things that are loaded once and not released. It can be preloaded items and effects or just streaming structure data. We also have pools that are slotted to help get around the fragmentation issue. These are used for things like vehicles and weapons.

To get back to your question, memory is very precious in the current console generation and as a result we do some very interesting things sometimes in order to make better use of it or to get around some random limitation. This can be something like loading a weapon that normally will not fit in a slot into the mission memory or loading textures for a vehicle into the world memory. I'm not trying to specifically say this is your problem, but it could be if the weapons fail to show up.

A more probable answer here is that the streaming container that is built from the .asm file has information about what mempool to allocate the memory from for the asset. If these weapon .asm files point to the mission pool still then you would have trouble loading them if there is a mission occupying the slot. Further you could run into issues trying to play a mission with them loaded. The solution there would be to change the allocator type from the mission allocator to the weapon allocator so it uses the weapon slots. As long as it fits in the slots it will work.

I'm trying to get some code out that will remove a good deal of these restrictions on the PC so that you won't have to worry so much about it, but that will take time. In the time being, you should look to alter the asm file rebuilder you have to change the allocator for the primitive(possibly just change the container type for the container and get all the prims in one swoop). A value of 0 for the allocator on a primitive means it doesn't override the value from the container. The .asm data format for containers is as follows:

uint32 signature(0xBEEFFEED)
uint16 version
uint16 num containers

if (version >= 8) {
int32 number of allocator remaps​
for each allocator remap:​
original allocator name(string prefixed with length)​
uint8 original allocator enum value​
int32 number of primitive remaps​
for each primitive remap:​
original primitive type name(string prefixed with length)​
uint8 original primitive type enum value​
int32 number of container type remaps​
for each container type remap:​
original container type name(string prefixed with length)​
uint8 original container type enum value​
}

for each container:
container name(string prefixed with length)​
uint8 container type (contains default allocator)​
uint16 load flags​
uint16 number of entries​
uint32 data offset for packfile​
if (version >= 12) {​
uint8 compression type​
}​
if (version >= 10) {​
stub parent container name(string prefixed with length)​
}​
int32 aux data size​
if (aux data size > 0) {​
aux data(aux data size bytes)​
}​
if (version < 9) {​
int32 packfile chain size​
}​
int32 compressed size​
if (packfile attached to this asm file) {​
if (version < 9) {​
uint32 * packfile chain size​
} else {​
uint32 * num_entries * 2​
}​
}​
for each entry:​
record name(string prefixed with length)​
uint8 original_type(remapping information for types is at the top of the file)​
uint8 original allocator(possibly remapped as well)​
uint8 flags​
uint8 index for filename extension​
uint32 cpu file size​
uint32 gpu file size​
uint8 allocation group​
 
I'm trying to get some code out that will remove a good deal of these restrictions on the PC so that you won't have to worry so much about it, but that will take time.

This may be the single greatest thing I have heard yet. :D
 
Back
Top