Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Optimization Sidedef / Sectors Lump - Texture entries #26

Open
sttng opened this issue Dec 10, 2021 · 3 comments
Open

Idea: Optimization Sidedef / Sectors Lump - Texture entries #26

sttng opened this issue Dec 10, 2021 · 3 comments

Comments

@sttng
Copy link

sttng commented Dec 10, 2021

Looking at the Sidedefs and Sectors format

Sidedef

x offset y offset Upper Texture Lower Texture Middle Texture Sector
32 0 GRAY1 GRAY1 - 7

Sectors

Floor Height Ceiling Height Floor Texture Ceiling Texture Light Level Special Tag
0 128 FLAT19 F_SKY1 144 8 0

Idea: Change Texture Name entry to Index (int16_t) similar to Doom 64 format.

This would need to be 1st implemented within GbaWadUtil. I guess a hashtable that keeps track of Texturenames already seen and replacing it with an int counter as necessary would work.

This could save a couple of bytes in cart/rom space. Not sure if there would be performance hits in the game to look-up

Also not sure if it'll be better to create an new look-up table for Texture-Index -> Name or directly modify the Map textures structure (name entry).

@RetroGamer02
Copy link

RetroGamer02 commented Dec 10, 2021

I can tell you that packing Sidedefs helped me a lot in GBAFreeDoom to save on ram.
The idea of building Optimization for it right into GbaWadUtil would be sweet.

@doomhack
Copy link
Owner

W_CacheLumpXXX returns a const* to the location in ROM.

On the GBA, the mapsector_t isn't loaded into ram.

The main memory usage on Plutonia Map 28 (Highest ram in Doom/2/Final Doom)

sector_t 17,836
side_t 44,416
linedata_t 20,168
_g->blocklinks 15,640
subsector_t 13,104
line_t 14,328
mobj_t 74,172

@sttng
Copy link
Author

sttng commented Dec 11, 2021

You could save ROM space with the suggestion I guess. As far as I can see:

Plutonia Map 28 (original <- not 'touched' with GBAWadUtil)
SIDEDEFS: 108.40KB
SECTORS: 7.54KB

Plutonia Map 28 (Texture Indices)
SIDEDEFS: 43.36KB (60% smaller)
SECTORS: 6.39KB (15% smaller)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants