mtasa-resources icon indicating copy to clipboard operation
mtasa-resources copied to clipboard

editor: multiple fixes & improvements related to LODs

Open Fernando-A-Rocha opened this issue 1 year ago • 6 comments

  • [X] editor_main: Makes useLODs setting enabled by default. It's a feature that the game uses for world objects, there is no reason to disable it for new maps.
  • [X] editor_main: Modernizes the map scripting extensions script: gets rid of the clientside engineSetModelLODDistance to 300, which did not make sense. Let's keep the default model LOD distances.
  • [X] editor_main: Adds missing LOD models to the table. Rockstar hid these object=>lod associations in binary IPL files. Fixes #555 Credits to @spooky-spook (spookysporks on Discord)
  • [X] edf & editor_main: Fixes LOD models not creating for objects during mapping

Fernando-A-Rocha avatar Oct 11 '24 11:10 Fernando-A-Rocha

Why would maps have useLODs disabled by default????? It's literally a game feature that should be enabled automatically for maps imo.

image

Fernando-A-Rocha avatar Oct 11 '24 11:10 Fernando-A-Rocha

Tested! Ready for review, im satisfied with the result

Fernando-A-Rocha avatar Oct 11 '24 12:10 Fernando-A-Rocha

New maps will look like this

This script's purpose is to make removeWorldObject map entries and LODs work

image

Fernando-A-Rocha avatar Oct 11 '24 12:10 Fernando-A-Rocha

I don't think that useLODs should be a good idea to be true as default, since most players are not aware of what LODs do in the first place. And this may affect players with low-end PCs. Other than that, seems like a good refactor overall.

chris1384 avatar Oct 11 '24 12:10 chris1384

The LOD object model only loads when the object becomes far away, replacing the normal object (or so it should). I doubt it's bad in terms of performance...

I know me and many MTA players have always hated seeing objects disappear at a low distance, due to the lack of LOD loaded because the script only did createObject once without assigning any LOD... It's especially frustrating and immersion-breaking in the map editor while you're mapping to see these objects disappear.

Fernando-A-Rocha avatar Oct 11 '24 12:10 Fernando-A-Rocha

Actually, keep this on hold. I'm gonna make a mtasa-blue function to return the new LOD_TABLE :-) It will be useful to have this in MTA itself

Fernando-A-Rocha avatar Oct 14 '24 14:10 Fernando-A-Rocha

Updated to use new upcoming feature from https://github.com/multitheftauto/mtasa-blue/pull/3831

Fernando-A-Rocha avatar Nov 20 '24 15:11 Fernando-A-Rocha

Work on this PR is paused until we figure out https://github.com/multitheftauto/mtasa-blue/pull/3831

Fernando-A-Rocha avatar Jan 01 '25 11:01 Fernando-A-Rocha

i cant test this PR due to these errors

EDIT: nvm getObjectLowLODModel still not implemented in mtasa-blue

[01:29:56] ERROR: [editor]\edf\edf.lua:33: attempt to call global 'getObjectLowLODModel' (a nil value)

[01:29:56] ERROR: [editor]\editor_main\server\interface.lua:11: call: failed to call 'edf:edfRepresentElement'

[01:29:56] WARNING: [editor]\edf\edf.lua:825: Bad argument @ 'getElementData' [Expected element at argument 1, got boolean]
[01:29:56] WARNING: [editor]\editor_main\server\IDhandler.lua:45: Bad argument @ 'getElementType' [Expected element at argument 1, got boolean]

[01:29:56] WARNING: [editor]\editor_main\server\IDhandler.lua:47: Bad argument @ 'getElementID' [Expected element at argument 1, got boolean]

[01:29:56] ERROR: [editor]\editor_main\server\util.lua:119: [editor]\editor_main\server\IDhandler.lua:71: attempt to concatenate local 'idString' (a boolean value) [string "?"]

[01:29:56] ERROR: [editor]\editor_main\server\util.lua:121: [editor]\editor_main\server\IDhandler.lua:71: attempt to concatenate local 'idString' (a boolean value)

q8X avatar May 30 '25 22:05 q8X

I will remake this PR. I don't think there will be an addition of a function to get the LOD of a model in mtasa-blue. So we need to do this in Lua.

I am thinking of a new resource. Map utilities or something like that. To handle LOD etc.

Fernando-A-Rocha avatar May 30 '25 22:05 Fernando-A-Rocha