Skip to content

Conversation

kalimag
Copy link
Contributor

@kalimag kalimag commented Sep 24, 2025

(continued from #4458)

  • Split definitions out into reusable module
  • Add sector and line definitions

TODO:

  • Complete player and mobj structs
  • Heretic and Hexen enums
  • Misc domain?
  • Make structs more convenient to use
    Ideally you can write code like for mobj in pairs(dsda.mobjs) do print(mobj.type) end and all the memory reading is abstracted away
    • Better array handling
  • Remove Objects cache in things-lines.lua (doesn't work with spawned objects)
  • Cache lines instead?
    Seems to be a big performance cost on fancy Hexen maps

If time permits:

  • Center zoom
  • Filter more mobj types (blood, smoke, decorations, etc.)
  • Stop shooting while clicking the map buttons
    • Annoyingly, moving the map while paused isn't possible because of the way gui.text works

cc @vadosnaprimer

Check if completed:

@vadosnaprimer
Copy link
Contributor

Misc domain may have to wait until I gather feedback from Doom people.

@YoshiRulz YoshiRulz added Request: Feature/Enhancement For feature requests or possible improvements re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Core: DSDA-Doom DOOM engine core labels Sep 26, 2025
@kalimag kalimag force-pushed the pr/dsda-lua-module branch from 7a7f2aa to 56267ec Compare October 6, 2025 17:00
@vadosnaprimer
Copy link
Contributor

I think center zoom is done. Not 100% perfect but combined with mouse drag feels sufficient.

local COUNTITEM_COLOR = false -- 0xA0FFFFFF
local ITEM_COLOR = false -- 0xA0FFFFFF
local MISC_COLOR = false -- 0xFFFFFFFF
local INERT_COLOR = false -- 0x80808080
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend a Colors table.

dsda.LINE_SIZE = 256 -- sizeof(line_t) is 232, but we padded it for niceness
dsda.MOBJ_SIZE = 512 -- sizeof(mobj_t) is 464, but we padded it for niceness
dsda.PLAYER_SIZE = 1024 -- sizeof(player_t) is 729, but we padded it for niceness
dsda.SECTOR_SIZE = 512 -- sizeof(sector_t) is 344, but we padded it for niceness
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a Sizes table for these too?

local read_u8 = memory.read_u8
local read_u24 = memory.read_u24_le
local read_u32 = memory.read_u32_le
local readfloat = memory.readfloat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar shortcuts exist in the main script, looks like it makes sense to declare them once and then use everywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: DSDA-Doom DOOM engine core re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Request: Feature/Enhancement For feature requests or possible improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants