[Template] Fast Travel between hub levels via dialogue lump

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
dileepvr
Posts: 10
Joined: Fri Feb 02, 2024 9:18 am
Graphics Processor: nVidia with Vulkan support

[Template] Fast Travel between hub levels via dialogue lump

Post by dileepvr »

A barebones PWAD template that implements a fast-travel mechanic within a hub-type cluster using the DIALOGUE lump and inventory items.

Direct download link: https://drive.google.com/file/d/1WvRrhp ... sp=sharing

Couple of screenshots (talk to the boat to fast travel):




README:

The cluster and hub mechanism will automatically save the states of all the levels in the cluster, even through saving and loading. You can verify this by moving/destroying the barrels I've placed in some of the maps.

Basic Idea:

There are four levels in a cluster of the "hub" type. There is a canoe (3D model) in each level that you can "talk" to by pressing "use" on it.
If you have collected a partial or full world map (inventory items in the levels), the conversation will give you options to travel.
You can just view the world maps (once you've collected them) by using them from the inventory system.

Under the hood:

Since the conversation system cannot execute arbitrary scripts, but can check for, give, and take inventory items, all scripting had to be done through inventory items.
I have created inventory item types "passport" and "ticket" in zscript. Every level has its own passport and ticket type. Possession of passport to a level will make travel to that level appear as an option in the conversation/dialogue system.
Collecting a partial or full world map will give you the passport inventory items for all locations associated with that world map.
A ticket inventory item will immediately trigger a level change sequence and destroy itself after it is done. You can test this by giving yourself the tickets to specific levels from the console.
An EventHandler handles the on-screen displaying of the world maps, whether directly "using" it as an inventory item or while in conversation with the canoe. (I decided not to use the "panel" field in the DIALOGUE lump because I wanted arbitrary control over resolution and scaling)

Other notes:

As an exercise, I decided to give each location a unique character rather than just going with four square rooms with different textures for the template. I went with OTEX textures for this. I even threw in some royalty-free soundscape mp3 files to set the mood for each location to make a good first impression. This is responsible for most of the size of the template pk3.

It takes surprisingly little effort to create a sense of being in a larger world, and have the player look at a line horizon as if there is a distant shoreline if they could travel far enough.

If you don't want to use the dialogue/conversation system, you can create a different ui system with a fake mouse pointer to enable directly clicking on locations on the world map to travel to.

It should be trivial to recreate something like a Diablo 2 waypoint system as well.

Credits:

The textures used are from the OTEX 1.1 texture pack made by "Ola Björling (ukiro)". Link: https://doom.ukiro.com/

The OTEX texture "0GRATA04.png" was modified (as permitted) by me. It is a grating texture, and the spaces between the grating's bars were made transparent.

The sprite "SPMPA0.png" is from Heretic by Raven Software.

The partial ("WRLDMAPH.png") and full ("WRLDMAPF.png") world map images were derived from a randomly generated map image from Azgaar's online fantasy map generator: https://azgaar.github.io

The location markers on the world maps were derived from the "IN_X" image graphic from Heretic by Raven Software.

The Canoe Model and associated textures are a modified version of one made by billy102 and downloaded from https://free3d.com/3d-model/canoe-87934.html

The soundscapes for the four levels contained in the following files:
- coldwind.mp3
- oceanbirds.mp3
- seacave.mp3
- strongtown.mp3

were derived from royalty-free audio files downloaded from https://pixabay.com/sound-effects/

All the levels and scripts are created by me and are licensed under the the MIT license (See file "LICENSE.txt").

Other notable alternative implementations:

Many projects have fast-travel within a single map.
Hollowlands TC has a player place-able fast travel beacon that can be activated from other levels: https://www.youtube.com/watch?v=KcDqkK25LV8.
Selaco has a fast travel "subway" system for backtracking and deferred exploration/secret hunting.
The RAMP hubs by DavidXNewton often use a fast travel mechanic to visit community maps in any order by category: https://ramp.teamouse.net/
User avatar
Enjay
 
 
Posts: 26951
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Template] Fast Travel between hub levels via dialogue lump

Post by Enjay »

Neat idea.
Seems nice and functional.

I can definitely see this being useful in hub based mods, allowing the parts of the hub to feel more like pieces of an overall whole world (or whatever the maps represent).

Even though it takes longer and has a fade between maps, it somehow feels more cohesive than, say, the abrupt changes in maps like the first Hexen hub (to me anyway).
Post Reply

Return to “Resources”