Windows Loading small tiles externally for mod support

YanBG

Member
I want to allow people to change some of the visuals in my game but even if i make it an installer all assets except the included files are bundled together and can't be edited.
Each included image creates it's own texture page and this could work for couple big backgrounds(menu etc) but i want to do it for the terrains too. I use separate tiles and cramping them in the same image would require a lot of re-coding.
Some of the data is in ini files and the sounds are in the included files. All work well, they are structured in folders and can be swapped as long as they keep the old names.

How would you go about that functionality?
 

YanBG

Member
Thank you! This is very good but would probably reduce the FPS so i might drop that idea for now.
 

Yal

🐧 *penguin noises*
GMC Elder
You can load stuff from the "write" folder as well, not just from the "read-only" folder (where all included files are placed), so you could always instruct your modding community to place files there. GM treats both those as the same folder, and if a file with identical name (which I assume includes local paths, like a file in subfolder WriteFolder/Data/Sprite is treated as having the same name as one in ReadOnlyFolder/Data/Sprite... I'm not sure about it, but it would make sense) exists in both folders, the one in the write folder is used since it's supposed to be the most up-to-date.
 

YanBG

Member
Would that count as included file and create individual texture page for each sprite_add or i can just refer to the sprite's name like if it's in the resource tree?
 
S

seanm

Guest
I don't actually think it affects the FPS. it just takes the game longer to load because it has to create the texture pages during runtime.
But I'm not too sure about that.
 

Yal

🐧 *penguin noises*
GMC Elder
It'd create a new texture page for each load, like always.

You might be interested in buffer_set_surface(), I guess... it lets you create a surface from a buffer. I'm thinking that if you made a surface from all the sprites you dig up, and then either create a big sprite from that (and draw parts of it) or draw parts of it directly but risk having to reload it, you could manually construct your texture pages. Probably too much work, though.

And @seanm, the VRAM has room for a limited amount of texture pages; if you run out it needs to unload old pages and load new ones, and that takes time.
 
S

seanm

Guest
@Yal Yes, but assuming you don't use any of the internal sprites, and only use the external pages, you wouldn't have an issue.
 
Top