Page 1 of 4

improve monster movement

Posted: Sun Jul 24, 2011 12:35 pm
by Samuel
I had the idea to improve the monster (and npc) movement. Currently they can only walk up and down or left and right. It they come to an obstacle they stop.

Its not easy to decide how they should move. So I would like to ask you.

1) Perhaps only add diagonal movement
2) add some walk around obstacle code
3) combine straight and diagonal movement
4) your idea here ;-)

Re: improve monster movement

Posted: Sun Jul 24, 2011 6:15 pm
by kendraso
Is it possible to apply agro? So they come to us, like certain mobs. And then some try and run away?

Re: improve monster movement

Posted: Mon Jul 25, 2011 2:10 am
by Countvlad54
Dig for some underground creature would be a nice touch.

Re: improve monster movement

Posted: Mon Jul 25, 2011 4:59 am
by Samuel
kendraso wrote:Is it possible to apply agro? So they come to us, like certain mobs. And then some try and run away?
This is a good idea, but it is limited by the monster areas. Monsters have an area they cannot exit.
Perhaps aggressive monsters could go towards the player if he enters their area and cowards would flee when he enters.

This should be randomized otherwise it would be look like this: :D

Code: Select all

cccc......a
ccc......aa
cc......aaa
c......aaaP
Countvlad54 wrote:Dig for some underground creature would be a nice touch.
You mean they would pop up if the player is on one of the adjacent fields?

Re: improve monster movement

Posted: Mon Jul 25, 2011 12:55 pm
by Countvlad54
Yea, something like that, maybe young wyrms could do that.

Re: improve monster movement

Posted: Fri Sep 02, 2011 6:10 am
by michischmid2000
I think i would be also nice, if someone could set up movement animations, at least for the player.

Re: improve monster movement

Posted: Tue Dec 27, 2011 10:33 pm
by qTzal
On making monsters work different/better:
ignoring for a minute the work involved -
How much of a burden would it add to the overall program storage size, running memory usage and run speed/lag time for monster handling to done outside the maps?
In this manner monsters would not be tied to a defined spot and could be given more realistic(fun) behaviors.

Re: improve monster movement

Posted: Tue Dec 27, 2011 11:53 pm
by Samuel
qTzal wrote:On making monsters work different/better:
ignoring for a minute the work involved -
How much of a burden would it add to the overall program storage size, running memory usage and run speed/lag time for monster handling to done outside the maps?
In this manner monsters would not be tied to a defined spot and could be given more realistic(fun) behaviors.
IMO too much.
a) memory: You would need every map available in memory. (to know where monsters can go and where are obstacles [tiles would not be needed, this would be a no go.])
b) running speed: We currently have 280 maps with around 10 to 20 monsters on each of it. I think the world will get up to 750 - 1500 maps.
So we will need to calculate over 10000 movements each second. (thats not very much, but the worse thing about it is: it needs random access to the map obstacles which will probably slow it down because of paging)
c) If in addition to (b) the movement code would need some adjustments (like chasing or something like this) then lag will come for sure.

I fear we will loose the slow phones from it.

Re: improve monster movement

Posted: Wed Dec 28, 2011 7:52 am
by qTzal
Samuel wrote:a) memory: You would need every map available in memory. (to know where monsters can go and where are obstacles [tiles would not be needed, this would be a no go.])
Ok, so I'll admit to prior experience programing (C, C++, pascal, basic, VB, assembler) and that I really wasn't thinking that big. No where near that big.
There are maps and there are monsters native to that map. Monsters would not be able to follow the PC off one map to another; maybe you could make an exception for quest monsters - I don't see the need.
You could have a 3 minute countdown timer for a for recently accessed map; within that time an out of view map would only generate requests for respawns. If the PC re-enters within the timer countdown all the original monsters left behind plus any respawns would be placed on the map in randomized positions. We all know that after gamers video game monsters have the shortest attention span. There is no reason to expect the monsters will remember to hang around the exit waiting for you to return.

After the timer has elapsed the map resets to defaults, same as it is currently handled. Once the map resets it doesn't need to be in memory.
Samuel wrote:b) running speed: We currently have 280 maps with around 10 to 20 monsters on each of it. I think the world will get up to 750 - 1500 maps.
So we will need to calculate over 10000 movements each second. (thats not very much, but the worse thing about it is: it needs random access to the map obstacles which will probably slow it down because of paging)
True. I would expect that active monster positioning only needs to be calculated on the map that is currently occupied: see my attention span crack above.
Samuel wrote:c) If in addition to (b) the movement code would need some adjustments (like chasing or something like this) then lag will come for sure.
No doubt.
Samuel wrote:I fear we will loose the slow phones from it.
In addition to point c) I see a schism forming in development paths that lean towards a more authentic "Rougelike" experience or a "Gold Box" Pools of Radiance like experience. Andor's Trail definitely looks like it could easily move towards a Gold Box level playing experience, especially when phones about as slow as my Droid 1 die off.
I don't imagine that even quad core tablets are going to be up to a Baldur's Gate level of game play.
Maybe if someone comes up with a "uWoW" ...

Re: improve monster movement

Posted: Wed Dec 28, 2011 8:09 am
by ncer
You could also limit the type of monsters that could move through a larger area and also through which areas they can move (for example those giant wasps seem like they could be able to move through the entire area where the trees have been cut down, but no reason for them to go beyond, frogs on the other hand don't seem very mobile creatures and could probably stick to one map). In addition you would only have monsters move around on maps within quick reach of the player, so let's say 8 extra maps if you want to go 1 deep or 16 extra maps if you want to go 2 deep (most of the time it will be less as rarely there's another accessible map on each side of the current map). There's absolutely no need to be thinking about the entire game world to simulate larger monster movement.

The game is fine as it is though, but it would be nice to come across an unexpected monster here and there. Maybe alternatively maps can have a small chance of spawning a monster that is usually found on a neighbouring map? It feels a bit like a 'cheat' but it will get around the whole monster movement headache. You could even place spawning points for this near the exit towards that other map so the monster actually appears to be coming from that map.