Terrain issue with NPCs

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, Chris H

Post Reply
elvist

Terrain issue with NPCs

Post by elvist » Sat Jul 05, 2014 12:24 pm

Hey everybody! Long time no see!

I recently got back to my Ultima I ACK project so that I might have a completed Trilogy of Darkness rebuild. I barreled through my last setback and replaced all of my NPCs so that they are fully healed, and found a new problem.

In testing, I've found that none of my NPCs, specifically monsters or evil NPCs, will walk on terrain that has ANY kind of modifier attached. (with some exceptions).

I guess I'll get into the exceptions: My water tile is unpassable unless holding Item Boat. If I change the vehicle setting on any of my water based creatures to Boat, it works fine. If I set the Vehicle setting to Water, not so much even though this is indicated in the manual etc. This is not so much of a problem though as just giving my Sea Monsters a Boat solves it. I have a Forest tile, it is passable to the player, and presumably anything else, provided they aren't holding Item Aircar. Item Aircar counts as Item Boat, yet can go anywhere the user can, unlike the Boat which can only go where needed. If my player has Item Aircar then he can cross oceans and rivers and grasslands, but can not cross forests: this works as designed. If I give an amphibious creature Item Aircar as their Vehicle Setting, then they appear amphibious as they can cross water and land alike. Works very effectively; it restricts my lizardmen from entering forests, but I don't mind the restriction.

Problem: Because my Forest is set to Passable Unless Holding Item Aircar, NO NPC will cross it. Ever. This is not what was intended. If an NOC is set to Vehicle Nothing, then I want them to follow the player into forests.

Also, if an NPC is Forest based only and has their Vehicle setting set to Forest, they also will not move when placed amidst it even though this is contrary to the manual's indication.

This limitation/bug/feature has created other issues as well: If I create a tile Lava and attach a macro that hurts the player when they cross it then set create a lava lizard creature that lives in it I cannot set their Vehicle to Lava and have them move amongst it. For some reason, I also cannot create a vehicle that moves along it safely and only run the damage macro if player lacks it and then set the lava lizard to Vehicle Lava Boat. For some reason, the lizard still refuses to move across it. Through testing, It appears that attaching a macro to a terrain tile marks that tile as impassable to all NPCs regardless of Vehicle.

I'm still trying to track down the extent of the problem, but I've found other examples that I don't yet understand. I tile that is passable to all, unless a variable = x, may be placed on a map. If the variable = x then the tile appears as a wall. When the tile is passable, NPCs will avoid like the plague. Effectively making the tile passable only to the player.

Has anyone else run into this? I searched the forums and couldn't find anything, so if this has been addressed then I apologize. However if anyobdy knows of a workaround to this/these issue(s), I would love to hear it. I feel like I'm a day or 2 away from uploading this last chapter ti may Ultima I-III reimagines and need only overcome this obstacle to do so.

Thanks in advance, everybody. I'm sorry I haven't been around, and I hope some of you have enjoyed playtesting my last 2 efforts. I love this tool and the friends I've made in this community.

Cheers.

Admiral Ackguh
Posts: 131
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh » Thu Jul 10, 2014 12:58 am

I will have to look into this further. Most of the time, I have no problem with creatures and terrain. If I set a creature to be limited to a certain terrain, then it stays there. Otherwise, it stays on ordinary terrain. The only known bug is with passable terrain that happens to be a light source. Creatures avoid it. I have posted on this topic before.
- A:A:

elvist

Post by elvist » Thu Jul 10, 2014 7:43 pm

Thanks , man. I really appreciate it. I did find your previous post, about creatures avoiding light source tiles, but that doesn't seem to apply here. Creatures seem to only move freely on terrain with no macros passable to anyone, or terrain that requires a vehicle to pass and the creature has the vehicle (in my game). Seemed weird. I am using the v8 mega patch from rld, but I'm not sure if that's relevant.

Also, if I set a creature to a specific terrain, it definitely stays there as well. In fact it appears to be unable to move at all!

Thanks for getting back to me, if I can help or provide more info, please let me know.

Cheers,
elvist

elvist

Post by elvist » Thu Jul 10, 2014 9:49 pm

Quick update. 1 of the problems I had was in fact the problem where the tile was set as a light source; my lava tile. I turned off light source and the lava creature will move amongst the lava now. So the macro wasn't stopping it.

Still not sure about the others such as the forest tile as I double checked and it is not illuminated.

Thanks again,
elvist

Admiral Ackguh
Posts: 131
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh » Thu Jul 31, 2014 8:57 pm

elvist wrote:I turned off light source and the lava creature will move amongst the lava now. So the macro wasn't stopping it.

Still not sure about the others such as the forest tile as I double checked and it is not illuminated.
Are you still having this problem?

I have found that macros do not prevent creatures from entering terrain tiles. Perhaps you can take a screenshot of the troublesome terrain (Object Editor) and creature (Edit People/Creature), and post them here.
- A:A:

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld » Mon Aug 04, 2014 8:44 am

I am looking into this; I think there are a couple of related bugs having to do with the check of whether or not a creature can walk over a given space.

A couple of notes:

o Creatures are blocked unconditionally from travelling
over any terrain type except Space / Custom Space.
This means that currently a creature will never walk over
a Portal.

o Creatures can be set to 'flying mode' which allows them
to pass over any Space terrain, regardless of other settings,
by pressing 'F' when selecting a creature's vehicle.
Unfortunately, there is no way to differentiate between,
for example, land and water with this setting, so you
couldn't use it to let a land creature travel anywhere on
land and a sea creature travel anywhere on water.

elvist

Post by elvist » Tue Aug 05, 2014 3:13 pm

Thanks guys for helping me out with this, I really appreciate it.

I am still having some difficulty with it. The 2 culprits remaining are a space that swaps for an obstacle when unpassable and my forest tile. My forest is passable as long as not carrying item-aircar. Here are some screenshots of my forest space and a sample of some of the creatures that cannot move on/across it. 2 of them are set to only walk on forest which makes them "land-locked" since they can not pass the tile.

Image

Image

Image

Image

Image

Image

Thanks again, I hope this helps.

elvist

Admiral Ackguh
Posts: 131
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh » Tue Aug 05, 2014 10:48 pm

My forest is passable as long as not carrying item-aircar.
That may be your problem. Terrain passable "if not carrying" might be impassible to all creatures.
- A:A:

Admiral Ackguh
Posts: 131
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh » Tue Aug 05, 2014 11:38 pm

I checked basic terrain (preset space) objects for passability to creatures. They are passable to creatures only if PASSABLE TO is set to:

ANYTHING
ANYTHING AT ALL
ONLY IF HOLDING [creatures with that vehicle]

Creatures whose VEHICLE is the same value as the terrain's ONLY IF HOLDING item may pass. It can be any object type, not just vehicle. That allows dummy vehicle supertypes for use by creatures and COUNTS AS for other vehicles. (Such as a boat supertype for boats, ships, and aquatic creatures - see manual appendix.)

IIRC, he only solution to your problem would be to create an object (call it forest boots) that your character needs to walk in the forest. It can have weight of 00. Set the VEHICLE of forest-walking creatures to this item. If you aircar is a vehicle, set the entry and exit macros to remove and replace forest boots. If aircar is a misc. object, use step macro to set the INV for boots.

I am not sure that a dummy skill would work instead of a physical object, but if it does, you can use it. The advantage is, if it has no USE action, it will not show up on any inventory.
- A:A:

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld » Thu Aug 07, 2014 11:24 am

One workaround you could try is to have two different types
of forest spaces. In the first one, let's call it "Edge of Forest",
you can set the condition to prevent the player from
travelling through with the aircar. Creatures won't be able
to walk through this one.

The second forest type is "In Forest". This terrain type is
passable to all.

When you lay out the forest, have the interior of the forest
be the "In Forest" type, and surround the border of the
forest with "Edge of Forest". The player will be prevented
from going into the forest (with the aircar, or whatever
condition you want to enforce) by the "Edge of Forest",
and once inside, the player can't get the aircar (which had
been left outside the forest), so there's no need to
enforce the same condition on the "In Forest" terrain.

This allows the creatures that you want to place inside the
forest to travel around the forest interior freely without
having to mess around with any vehicles or anything, but
they will be prevented unconditionally from leaving the
forest by the "Edge of Forest" terrain type.

Code: Select all

   EEEEEE
  EffffffEE
  EfffffffEE
  EEEEEEEE

E - edge
f - forest interior

Admiral Ackguh
Posts: 131
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh » Thu Aug 07, 2014 12:20 pm

That would also work, <B>rld</B>, and would be simpler.

As for <B>elvist</B>'s other problem, of space that swaps for an obstacle when unpassable, my suggestion would be get rid of the DISAPPEAR and REPLACED options. Use the step macro to do the swapping. I know, this will make game play slower, but it might be the only solution.
- A:A:

elvist

Post by elvist » Thu Aug 07, 2014 2:49 pm

Wow! I can't thank you guys enough for all of your help. The info on how NPCs determine where they can move and can't is very helpful.

I very much appreciate the suggestions for workarounds. I'm going to explore those options this weekend and hopefully be able to upload by early next week. I had considered a forest border tile that behaves as the forest does now, but then started considering an elaborate addition to the step macro that would use map check and key logging to accomplish the effect I was after. I was dreading it though because I knew it would big the games performance down considerably. All of your suggestions are WAY more elegant than mine and I'm excited to get back to work on this thing.

Thank you both so much for your assistance, I truly appreciate it!

Cheers,
elvist

Post Reply