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

Add mapfixes resource #504

Merged
merged 42 commits into from
Aug 13, 2024
Merged

Conversation

Fernando-A-Rocha
Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha commented Jun 21, 2024

This is intended to patch some flaws in the default MTA world, caused by missing objects that would usually be loaded in the singleplayer game.

Contributors to this mini-project:

List of map fixes

Objects were spawned using the exact positions provided in the game's IPL files.

  • Big Smoke Crack Palace wall covering the hole (1 object spawned)
  • Big Smoke Crack Palace open-world interior (2 objects spawned) - disabled by default
  • Commerce Atrium Lobby open-world interior (2 objects spawned, 4 door objects replaced with openable doors of the same model)
  • Doherty Safehouse Garage open-world interior (7 objects spawned and 1 garage opened)
  • Restored Undamaged SF Crack Factory with open-world interior (27 objects spawned and 4 objects removed)

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 21, 2024

Big Smoke's Crack Palace

Hole patched with 2 objects loaded from the game's carter.ipl binary IPL file.

Before:

bigsmoke_before

After:

bigsmoke_after

bigsmoke_after2

I believe this is essential for most servers.

Feel free to contribute 😄

Copy link
Contributor

@Nico8340 Nico8340 left a comment

Choose a reason for hiding this comment

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

I think we should make this resource much more customizable.
It would be best if each patch had a separate identifier or name, and could be turned on and off in meta.xml, or even configured if there are multiple available options.

@jlillis
Copy link
Contributor

jlillis commented Jun 21, 2024

It would be best if each patch had a separate identifier or name, and could be turned on and off in meta.xml,

I think that's a bit overkill for this purpose. This should just be a simple map resource that fixes obvious holes for the purposes of the freeroam gamemode and other simmilar modes. Ideally I'd have it be a literal .map and nothing else, but there is no integration of the new building functions in the map editor yet.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 21, 2024

I think we should make this resource much more customizable. It would be best if each patch had a separate identifier or name, and could be turned on and off in meta.xml, or even configured if there are multiple available options.

What I can think of is having meta.xml settings to enable/disable each patch individually. Wouldn't this be okay?

@Fernando-A-Rocha
Copy link
Contributor Author

Lazy server owners would be able to toggle the patches via the Admin Panel by accessing the resource settings menu.

@Fernando-A-Rocha Fernando-A-Rocha marked this pull request as draft June 21, 2024 00:47
@Nico8340
Copy link
Contributor

What I can think of is having meta.xml settings to enable/disable each patch individually. Wouldn't this be okay?

I mean that's quite enough, yes.
If we don't use a map, it might be worth using the new building functions, right?

@Fernando-A-Rocha
Copy link
Contributor Author

What I can think of is having meta.xml settings to enable/disable each patch individually. Wouldn't this be okay?

I mean that's quite enough, yes. If we don't use a map, it might be worth using the new building functions, right?

Yes sir, if you look closely at the code I used createBuilding and meta.xml has the min version adequately xD

@Nico8340
Copy link
Contributor

My bad, sorry.

@Fernando-A-Rocha
Copy link
Contributor Author

Let's get more feedback from the community on how this should work.

@Dark-Dragon
Copy link
Contributor

Personally I'd say the highest priority are obvious erroneous differences between singleplayer and mta, such as big smokes crack den or the blown up warehouse in san fierro. However discussion on discord seems to indicate the scope should be much wider and include the more minor issues like missing collision in geometry that could result in accidentally or purposely falling through the map. While I don't see a desperate need for these issues to be addressed, I don't see any problem with taking on the task if enough people are interested in dealing with it. I would however say these should be resolved by fixing the models rather than band-aiding around them.

If this resource ends up addressing more than the couple glaring mistakes, I'd say a setting for each fix in the meta.xml is desirable.

@NanoBob
Copy link
Contributor

NanoBob commented Jun 21, 2024

I think if you want this to be of any value it needs to be configurable.
Being able to enable or disable specific fixes would allow a server to use this if they do use some of these areas.

Another thing that's worth considering is making multiple alternatives for a single "fix".
For example in this case one fix would place the interior behind it like you've done now. And another would be to place the wall that covers up the hole. As some servers might not want the interior there.

This also would be done by making them configurable, as you could just disable the wall if you want the interior bit.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 21, 2024

Ok. Solid points.

My idea to make it configurable is create several meta.xml settings and listen to changes using the event onSettingChange to reload the patches accordingly. Any better alternatives?

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 21, 2024

Did as suggested. Demo video:

https://streamable.com/cdkhgq

@Fernando-A-Rocha Fernando-A-Rocha marked this pull request as ready for review June 21, 2024 15:18
@Fernando-A-Rocha
Copy link
Contributor Author

I think the system doesn't need to get more complex than this. Let's keep adding actual map fixes related to spawning/removing objects. We'll sorry about game model modifications later imo.

Copy link
Contributor

@Nico8340 Nico8340 left a comment

Choose a reason for hiding this comment

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

Good job!

[gameplay]/mapfixes/client.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/server.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/server_data.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/client.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/client.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/server_data.lua Outdated Show resolved Hide resolved
Fernando-A-Rocha and others added 2 commits June 21, 2024 19:01
Added two interiors 'Doherty's garage and 'just business' mission'
@THEGizmoOfficial
Copy link
Contributor

I would add two more interiors that are the same size as their buildings, so they do not protrude beyond the outline and are not available in the open world :D
mta-screen_2024-06-23_13-32-22
mta-screen_2024-06-23_13-32-35
mta-screen_2024-06-23_13-33-17
mta-screen_2024-06-23_13-33-27

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 23, 2024

@THEGizmoOfficial These are nice map improvements. We can definitely add them to this resource. Obviously they will be toggle-able, but I think they really fit the freeroam gamemode which is the Default MTA Server gamemode.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 23, 2024

Added 2 more original open-world interiors.

Here the interior was placed, and the garage ID 22 was opened using setGarageOpen.

image

//

Here the interior was placed and the entrance doors removed.

I'm thinking of spawning the doors at the same position, and making them pushable (setting model group to the same as Gen_doorINT04 which the player can push to open).

image

@tut001
Copy link
Member

tut001 commented Jun 26, 2024

If MTA wants to remain lightweight and avoid shipping hundreds of slightly modified original assets, then you'd be better off adding COL/DFF/TXD fixes as a community resource and letting other users contribute. There are hundreds of broken COL models, if not thousands of exploits for access to blue hell, or the insides of buildings. I have, like others, created many fixes for these but they keep becoming more obvious when working with different models. That's only COL issues. There's a lot of DFF issues as well if you take into consideration minor issues like zfighting, prelight, or IPL/mesh offsets that create tiny blue hell gaps in the world. At some point you'd be looking at redistributing a large portion of the original game's files, like a mod pack would.

If this is something that's maintained by MTA then it would add quite a lot of file sizing to servers that either have their own fixes already, or just don't really care for non-gamebreaking issues. Whether it's toggled on I imagine it would still be distributed as part of MTA installation.

What about file standards?
A game modder with sufficient knowledge of art, topology & RW data would be required to inspect & approve every file that's submitted, and to set an official standard. Also, if people begin using different importers/exporters, which is known as destructive-editing (i.e. saving JPEG photographs instead of RAW for grading, or continously re-compressing images by editing & saving as JPEG), then there is a risk of breaking the file data because different plugins handle data differently. This is something that is all too common in the world of modding, and sadly many talented game modders still actively encourage without considering that it breaks stuff. It isn't the same as submitting a piece of text that says "Hello world". When someone modifies the file it may become "Hell world" and you have a problem. This happens a lot more frequent than some may think. Instead of per-server mods we're talking official resources meant for everyone, where a set file quality & size standard is expected.

Missing interiors on the other hand, sound reasonable as it's easily kept non-destructive and exclusively code based

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 26, 2024

@tut001 Unfortunately you're right, we can't distribute dozens of modified game models with MTA. If we kept going with these model fixes it would eventually never end.

I've removed them from the resource, and I'm fine with calling it completed soon & ready for final review.

Thanks for your input. Solid points!

@Fernando-A-Rocha
Copy link
Contributor Author

For those still interested in the Model Fixes project, I've made it a separate branch on my fork.
https://github.com/Fernando-A-Rocha/mtasa-resources/tree/model-fixes-resource/%5Bgameplay%5D/modelfixes

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jun 27, 2024

Main PR post updated.

Ready.

[gameplay]/mapfixes/scripts/client/main.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/scripts/server/data.lua Outdated Show resolved Hide resolved
[gameplay]/mapfixes/scripts/server/main.lua Outdated Show resolved Hide resolved
@Fernando-A-Rocha
Copy link
Contributor Author

Done @Nico8340

and rename some settings + new setting friendly names and descriptions
@Fernando-A-Rocha
Copy link
Contributor Author

Added original Big Smoke Crack Palace wall covering the hole

This object is present throughout the entire game except after the last mission where CJ drives through it with a S.W.A.T. vehicle, destroying the wall.

The object is set to unbreakable and frozen so it cannot be destroyed, the same as during the entire storyline.

The interior added behind was now set as disabled by default.

image

@jlillis
Copy link
Contributor

jlillis commented Jul 6, 2024

Got any more fixes you want to include?

I've removed them from the resource, and I'm fine with calling it completed soon & ready for final review.

While I wouldn't approve of adding "dozens" of models, perhaps we can consider a small number of collision fixes for the most glaring issues?

Do we want to make this a freeroam dependency?

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jul 6, 2024

Got any more fixes you want to include?

Not for now.

we can consider a small number of collision fixes for the most glaring issues?

I believe the game model fixes can be a separate resource that I'm working on a separate branch on my fork (modelfixes). The resource of this PR is for reimplementing missing objects from singleplayer.

Do we want to make this a freeroam dependency?

I think we do! These map modifications are perfectly compatible with the freeroam gamemode. Otherwise, it becomes just another forgotten resource if not made default.

@Nico8340
Copy link
Contributor

Nico8340 commented Jul 8, 2024

I tested and reviewed the resource, but I think we should approach it in a different direction.
If the resource focuses solely on fixes, then it should only contain fixes, such as replacing the wall of Big Smoke's Crack Palace, but not opening the Atrium interior.

I don't think it should contain models, but it could contain some small collision fixes.
If you remove the elements from it that are not specific fixes, then there is not much left, so expansion is an option either now or in the future.

@Fernando-A-Rocha
Copy link
Contributor Author

@Nico8340
So, do you propose removing the Commerce Atrium Lobby open-world interior?

Feel free to suggest the collision fixes you think we can include in this resource.

@Nico8340
Copy link
Contributor

Nico8340 commented Jul 9, 2024

@Nico8340 So, do you propose removing the Commerce Atrium Lobby open-world interior?

Feel free to suggest the collision fixes you think we can include in this resource.

Exactly

@Fernando-A-Rocha
Copy link
Contributor Author

Ok. @ community Please state the most important collision fixes and similar that should be fixed, to get this PR to a ready state.

@jlillis
Copy link
Contributor

jlillis commented Aug 7, 2024

At this point I think this is ready to merge. If anyone wants to add collision fixes they can follow up in a later PR. If there are no objections I'm just gonna send it this weekend.

@Fernando-A-Rocha
Copy link
Contributor Author

Yep

@jlillis jlillis merged commit 23f6bd9 into multitheftauto:master Aug 13, 2024
1 check passed
@Fernando-A-Rocha Fernando-A-Rocha deleted the add-map-fixes branch September 1, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants