one-time enemies

I'm new to the boards but I've been using Coldstone for a while. There's one thing I don't get, though. In Pillars of Garendall, they seem to be able to make it so that if you defeat a goblin in the forest, go to a different map, then return to the same map, the goblin doesn't return.

For the NPC 'death' action, I thought they might make a global that tells the location not to place the same monster if its been killed, but that isn't realistic. They couldn't possibly make globals for every last monster, so how do they achieve this?

Stefan, on Mar 30 2005, 01:44 AM, said:

I'm new to the boards but I've been using Coldstone for a while. There's one thing I don't get, though. In Pillars of Garendall, they seem to be able to make it so that if you defeat a goblin in the forest, go to a different map, then return to the same map, the goblin doesn't return. For the NPC 'death' action, I thought they might make a global that tells the location not to place the same monster if its been killed, but that isn't realistic. They couldn't possibly make globals for every last monster, so how do they achieve this?View Post

well heaven, it was a major grossing game release...and near as i can tell there's nothing simpler than using the huge number of globals. you should see all the work they put into cosmic memory.if there were arrays i could see the npcs using their id number to check an arraygoblin(36) = 0 => which would mean dead goblin...so the goblin would terminate itself or the game would or something....but that's not possible.but then again, if its well planned and something you deem necessary...it's the price to pay.seriously i can't think of anyway within the bounds of teh engine that would allow for that..

ellrx, on Mar 29 2005, 09:56 PM, said:

well heaven, it was a major grossing game release...and near as i can tell there's nothing simpler than using the huge number of globals. you should see all the work they put into cosmic memory.if there were arrays i could see the npcs using their id number to check an arraygoblin(36) = 0 => which would mean dead goblin...so the goblin would terminate itself or the game would or something....but that's not possible.but then again, if its well planned and something you deem necessary...it's the price to pay.seriously i can't think of anyway within the bounds of teh engine that would allow for that..
View Post

hmmm...somehow I can't see myself spending the time on that. It's just that they would need literally hundreds of globals for monsters alone...seems like a lot of work for a rather minor problem. Thanks anyway, though.

Stefan, on Mar 29 2005, 09:44 PM, said:

In Pillars of Garendall, they seem to be able to make it so that if you defeat a goblin in the forest, go to a different map, then return to the same map, the goblin doesn't return.
View Post

Not so. There are three groups of enemies which do not regenerate when killed; the demon kobolds blocking the road south of Gwyden Camp, the Killer Ookwasps hovering around the Tearos River bridge, and the Cyclopes which threaten Dernath. The thieves who stole the statue from Captain Juliar may be a fourth group. All other creatures will re-populate a map when you leave and re-enter. They are placed there with a load call for each map. The groups mentioned above are controlled by globals.

However, there is no reason that the game could not have every NPC controlled by globals. The problem would be that you would run out of monsters to fight before you had gotten very far up the level ladder. The game would also be very dull if all the monsters were gone and you had to move across those barren maps to get from one area to the next to complete the quests.

If you wished, you could randomly place a different number of creatures in each map, or even change the type of creature which appears each time. This would be done in the load call events list.

Well, our Garendall expert has almost all of it covered I guess. In Garendall, the enemies are randomly placed in the maps but they do reappear not just at the same location. If you really don't want enemies to reappear, do this:

Create one global per hostile area.
Create one monster per hostile area.
Say that you make one called "SouthRoadCavernTroglodyte.npc", in it's death event, just make it add one to a global named, say, "Gb_SouthRoadCavernTroglodytes". So, when the player enters the "SouthRoadCavern.map" map, there will be a conditional. "If Gb_SouthRoadCavernTroglodytes is equal to 0, add ten Troglodytes". The "Add" action would be NPC control. Then, if not, it will call "Nine Trogs left?" and so on down to one and after one nothing would happen. Might seem a bit complicated but I've used it in one of my games and it works.

Good luck!

Ledorax, on Mar 30 2005, 10:47 AM, said:

In Garendall, the enemies are randomly placed in the maps but they do reappear not just at the same location.
View Post

This is true for most maps. However there are some maps where the creatures are always in the same locations. The map with the Learning Tree is one example and the map with Gewin, the herbalist, is another. In maps with both good guys and bad guys you really have to dictate where they all are to avoid mixing bad guys in with the good. It would not do to have Emelius surrounded by nasty goblins instead of friendly monks and nuns. There are also some maps in which you cannot access the entire map from one entry point. One type of creature lives on one side of the river and a different creature inhabits the other side (see the map with Morgo's Termite Farm.)

I think the point to all of this is that you have a certain amount of freedom to script the action in various ways which best suit the game. You can also have some monsters consistantly placed (perhaps to guard a treasure) while others are placed at random, all within the same map.

Rubber Ducky, on Mar 30 2005, 03:45 AM, said:

If you wished, you could randomly place a different number of creatures in each map, or even change the type of creature which appears each time. This would be done in the load call events list.
View Post

Load call is only for plugins ;O

That is a nice idea though. Less monotony, and it may even be easier than placing them all.

The idea of placing enemies randomly is interesting...I might consider that.
Using globals would just get to tedious, I think.

But when it places an NPC randomly, it knows not to put it on a cell whose access is blocked, right?

Stefan, on Mar 30 2005, 07:48 PM, said:

But when it places an NPC randomly, it knows not to put it on a cell whose access is blocked, right?
View Post

Right.

Here's something else to consider. If a portion of your map is inaccessible to the player but left open, some of the random characters may (probably will) end up there. This, in effect, produces a different number of foes to fight each time you enter the map. The foes which are in the inaccessible area are out of sight and out of reach. This trick was also used a few times in PoG.

Rubber Ducky, on Mar 30 2005, 10:33 PM, said:

Right.

Here's something else to consider. If a portion of your map is inaccessible to the player but left open, some of the random characters may (probably will) end up there. This, in effect, produces a different number of foes to fight each time you enter the map. The foes which are in the inaccessible area are out of sight and out of reach. This trick was also used a few times in PoG.
View Post

That's also an interesting idea. Otherwise, if you wanted to take the time, another option would be to define the precise locations where monsters will appear, but use 'random actions' to ensure that the monsters appearing there will always be different or may not be placed at all. This would eliminate the need to worry about having monsters placed where they aren't wanted.

I plan to use leddorax's "Population" method in Anira, but in less detail.

What I will do is break up all my maps into 4 - 9 map "Areas" that will each have a global for the population, like "gb_Luthar Forest Goblins" and "gb_Luthar Forest Sesne" that represent the population of certain monsters is a area. So if you walk onto a map in the "Luthar Forest" area in the day or sunset, it will set a global to be "gb_Luthar Forest Goblins" and then divide it by 7 and add that many goblins to the map.

EDIT: Every day it will add some to the population of all maps that are lower then normal.

This post has been edited by Yoggy : 07 April 2005 - 04:02 PM

Stefan, on Mar 30 2005, 11:48 PM, said:

The idea of placing enemies randomly is interesting...I might consider that.
Using globals would just get to tedious, I think.

But when it places an NPC randomly, it knows not to put it on a cell whose access is blocked, right?
View Post

Whoa... this gives me an idea.

Remember in Stark's spells plugin, where he had a blink spell?
This spell had the possibility of trapping you in an access blocked tile.

Well, what if you used the NPC control "place random in map" action to make sure this never happened? All you do is place a random NPC somewhere, then kill it right after. In the NPCs death action, put an event to set ActualX and ActualY to NewX and NewY (or any global you want). Then teleport the player to NewX and NewY.

I'm not sure uf that would work, but it may be a way to help check tile access.

OgreBob, on Apr 8 2005, 09:28 AM, said:

Remember in Stark's spells plugin, where he had a blink spell?
This spell had the possibility of trapping you in an access blocked tile.

Well, what if you used the NPC control "place random in map" action to make sure this never happened? All you do is place a random NPC somewhere, then kill it right after. In the NPCs death action, put an event to set ActualX and ActualY to NewX and NewY (or any global you want). Then teleport the player to NewX and NewY.
View Post

It's unclear what you're trying to do here. If the NPC is placed randomly it will not land on a blocked tile. Why kill it, and move it, and then teleport the player there? If you want the NPC on NewX and NewY, just put it there from the start.

The reason "blink spell" could send a player into a trap is that "blink" selected a random set of co-ordinates and then teleported the player. When the player lands there, that tile is no longer blocked. But if all the surrounding tiles are blocked, the player cannot move. Any time a player is sent to a blocked tile the tile remains unblocked for as long as the player is in that map. As soon as he leaves (and returns) access is blocked again.

Rubber Ducky, on Apr 8 2005, 02:47 PM, said:

It's unclear what you're trying to do here. If the NPC is placed randomly it will not land on a blocked tile. Why kill it, and move it, and then teleport the player there? If you want the NPC on NewX and NewY, just put it there from the start.

The reason "blink spell" could send a player into a trap is that "blink" selected a random set of co-ordinates and then teleported the player. When the player lands there, that tile is no longer blocked. But if all the surrounding tiles are blocked, the player cannot move. Any time a player is sent to a blocked tile the tile remains unblocked for as long as the player is in that map. As soon as he leaves (and returns) access is blocked again.
View Post

I think what he means is that since enemies that are placed randomly can't be placed on a blocked tile, you can put one down randomly (when the spell is cast) and then teleport the player to its location, negating the chance of landing on a blocked tile. You would have to kill a monster to do this, to get its ActualX and ActualY for the game to reference. It would be like randomly teleporting, but with no chance to trap yourself under normal circumstances.

EDIT for clarity

This post has been edited by Boomstick : 08 April 2005 - 02:18 PM

Yes, thank you Boomstick.