-
Notifications
You must be signed in to change notification settings - Fork 25
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
Portal abstraction #8
Portal abstraction #8
Conversation
All in all the proposed changes all sound really good. I'd be a little conservative with introducing new elements and make them dependent on other mods (caverealms) but thumbs up on your approach. |
The API adds a Book of Portals to treasure that can be found, so players can discover portal types they didn't know about. That adds a soft dependency to loot and dungeon_loot mods. Support for the Treasurer mod could be added later without nether needing a dependency, via a separate "Treasure Registration Mod" in their modpack A soft dependency to the help encyclopedia will also be added. |
The API is at a point where complete custom portals to other realms can be created, and looks much like I expect it will when finished. What still remains is adding another example portal shape and making the example portals go somewhere other than the Nether etc. I don't expect to anybody to check it or test or play with it, but if someone does then it's at a point where feedback would be more meaningful than earlier. A point of interest may be storage of portal locations in mod_storage - used to avoid having to find new portal locations if there's already a portal in the area. The limitations of mod_storage lead to a system that feels suboptimal, but optimizing a list of portals would probably be like optimising an idle loop anyhow. The storage of portal locations is treated as unreliable, so I can also just disable it if mod_storage api isn't available. |
Seems very promising just from the commit messages and all. Please TCP me when you want some testing - I see there's a merge conflict but if you resolve that I'd love to try it. |
Merge conflict resolved. I'm on holiday in Germany at the moment so updates will be a bit sporadic, but the main stuff is done and should be bug free, so testing would be great. (not sure what "TCP me" meant, perhaps an @sofar mention?) |
Uh.. This is a monstrosity of a PR, changing most of the code in @sofar Do you have any further remarks? EDIT: It might be a good idea to add you as a repository owner if you're interested to maintain this mod. |
Yeah, these pull requests are not fair on you two. The original text of this PR was
And I raised the question of a dev branch in PR #13. On the bright side there's only a couple of feature I still want to add, and I have to slow down now. I would be interested in being added to the nether repository owners list.
The ascii art isn't good - I agree. I'm weak on formspec but I suspect implementing a markup language in the portal API so that you can include an image when calling register_portal() would not be simple. The portal shape definitions could provide an image, but it would have to be without texture. Otherwise calls to register_portal() could be required to pass an image separately from the description string. |
The Book of portals now uses images instead of ASCII art, and I think is much better for that criticism. Because I don't know how much space text will take up, or where it will end, and I need coords to place an image and can't wrap text around it, I've spaced entries out as much as possible. With 4 entries this looks like quarter of a page each. Not the best typography but I'm sure you understand the limitations.
I don't know what it would look like on an android. Normally there won't be 3 portals though. By default there's only one portal, which means the introduction is on the left page and the Nether Portal is on the right page. |
I can not wait for it to be merged. |
I quickly checked the PR - looks good. Before rebase & merging:
|
Thank you for looking at it. I meant to mention when you said "changing most of the code in nether" that this PR should only be changing the portal code: the mapgen code is moved into mapgen.lua, and the nodes/crafting is moved into nodes.lua. I just did a diff on those files and the originals to make sure nothing important changed. (PR #13 will make changes to the mapgen code, but still retains the original code in mapgen_nobiomes.lua for version 0.4 of MT and v6 mapgen worlds. Again PR #13 should be seamlessly compatible, with the exception of limiting the nether by user-adjustable default to 11000 deep. Can discuss that PR another time) Take a tag or branch of the nether mod before the merge. Rolling back, or forward between the two branches shouldn't break anything. I'm ok with a squash-commit, I think the history will be retained in my treer/nether fork. 70 commits for this change is too much. I may have misunderstood "last chance", but have just pushed a minor change that was still sitting on my computer. |
@FaceDeer Okay, it's good to hear that the map will be compatible.
With this I wondered whether you would like to squash some commits ( |
73ac96b
to
cc7924a
Compare
ah, yes, I've squashed a bunch of commits. The history is much tidier. |
3117d73
to
6c2ae8a
Compare
Allows dev and testing/debugging to focus on one (shape or behavior) without getting mixed up in the other, will also enable different portal shapes later on. Other adjustments: * Reuse/reignite an existing portal or portal frame if there is one at the remote destination, rather than the area being overwritten by a slightly offset portal schematic. * Create remote portals in a matching orientation to the local portal. * Preserve player position & facing relative to portal when traveling through wormhole (even if portals are at 90°) * Players no longer bounce several times after teleporting * Player is not teleported until after the portal at the other end is confirmed/built
Portals can be switched on and off with mesecons (from a tech-tree perspective, mese is still required for portal ignition)
e.g. allow remote ignition to a portal in a "portal room"
Part of e5a5db9, fixes an issue where node timers weren't stopped by extinguish_portal(). And tweaks some comments
UTF-8 with BOM crashes some systems according to 6551f5c comment, and there are several cases where Minetest is buggy with files that use CRLF line endings (though none I'm aware that affect these files), so strip CRs and BOM
and other work on the portal examples also documentation and fixing issue where apples prevented volume_is_natural() from returning true
give nether_portal_circular.mts a flat floor - the new nether_portal_circular.mts allows its bottom nodes to be sunk into the ground. Example portal basic behavior and book_of_portals_pagetext implemented. Other changes are allowing portals corrupted by ABMs to be repaired, finding better ground level of surface portals.
out of the portal defintion
When a surface level was known, only the volume_is_natural check was being performed, this fixes that. Also fixes bug where LBM didn't start the timer of example portals that had been disabled. Allows portal ignite to repair a stopped timer. Other misc cleanup - paramat's new Floatlands won't have lakes so I removed that from the flavortext.
Issue was raised as a pull request against the original code - minetest-mods#12 Also replaces deprecated getpos/setpos with get_pos/set_pos - minetest-mods#11
wormholes now emit mesecon energy, allowing mesecons to know the state of the portal. (mesecons could previously only set the state of the portal)
Also adds nether.register_wormhole_node(), moving the wormhole node template into portal_api.lua, and allowing wormhole nodes with custom post_effect_color to be more easily created.
Changes to reduce formatting warnings will be committed separately
This eliminates most luacheck formatting warnings
Also a minor change to prevent surface portals from appearing in a grid pattern in MT 0.4
https://forum.minetest.net/viewtopic.php?t=15912 Don't place Book of Portals in dungeon chests if its contents can be written in the help modpack Encyclopedia instead, and don't add Book of Portals to dungeon chests if Nether portals are the only type of portal - A Nether mod doesn't need a Book of Portals if it's only being used to provide a Nether portal.
Save some bits. Unfortunately PNG can't do 3bit-indexed images :(
If a portal is being ignited and portal frame near-but-not-at its destination was found that was active and already linked back to the local portal, it would cause the local portal to be extinguished. (Required the remote portal to somehow be in a different state from the portal it was linking to)
Removes the need for the get_malleated_schematic_filename hack
6c2ae8a
to
7a1da63
Compare
I've rebased it onto the current master. Should work now. |
Improvements found while using the portals API in another mod (cloudlands): * remote_portal_checkup() will check the whole portal and frame for mapgen overwrites. * Allow find_realm_anchorPos() to return nil if no realm location could be found (portal will fail to ignite). * Allow create_book_of_portals() to be invoked [indirectly] by other mods. Also lowers nether_book_close.png to be 4bpp
7a1da63
to
b31df12
Compare
Thanks for your efforts! |
This is ready for review/merging.
Sound effects/ambiance, and more particle effects
Nether can be used for fast-travel, like in Minecraft (configurable in mod settings). Creates a reason for players to tech to Nether and go there. Especially without sprint.
Portals will normally spawn on the surface instead of underground (MT5 only)
Reuses/reignites existing remote portals, allowing portals to be turned on and off or repositioned in a room with predictable results - old mod would link to entirely new locations each time a portal was ignited. I took predictable behaviour for granted in Minecraft, and have come to realise it was required for the emergent portal gameplay.
Internationalization
Portal API created. A solid portal implementation that's forwards and backwards compatible with the earlier system.
Add mesecons support - portals can be switched on and off with mesecons, and wormholes emit mesecon energy. From a tech-tree perspective, mese is still required for portal ignition.
Replaces ABMs with a single node timer.
Remote portals are created in a matching orientation to the local portal.
Preserve player position & facing relative to portal when traveling through wormhole (even if portals are at 90°)
Player is not teleported until after the portal at the other end is confirmed and built.
Players no longer bounce several times after teleporting
A Nether portal beside the playable API example portals (which are disabled from the game by default):
The Book of Portals - a player guide that appears in dungeon loot if there are extra portals available:
You can ignore the older version of this message below:
When I said I was looking to make a lot of changes and sofar said "Just send PRs", the scope of changes wasn't obvious, so I'm raising this pull request early to be less of a shock/get earlier feedback.
These are "phase 1" changes that add nothing new or interesting to game, and should be forwards and backwards compatible with existing maps and nether mod, but are starting to abstract the portal physics and handle more edge cases. Unfortunately handling edge cases adds more code, so I don't know whether this PR will run against any "worse is better" beliefs.
Motivation
Hardening the portals feels like the first step: The Nether in Minecraft adds something epic to the game that captures imagination, and I feel this is missing in MT even after you install the nether mod - I want a nether mod to affect the game, inject itself as an important part of any world that has the mod installed. I think a lot of that can happen without breaking compatibility.