Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

NPC Movement Frequency


Mohenjo Daro
 Share

Recommended Posts

Alright, so I've been toying around with EO (base 2.0) and changed the NPC speed but the frequency of how often, NOT fast, they move looks weird and I'm trying to find where the code is in the source for movement.

So basically I want the movement to be more fluid rather than jerky.

Also, I'm planning to add a scrl bar to judge what the frequency is, don't think that will change anything though.
Link to comment
Share on other sites

> Alright, so I've been toying around with EO (base 2.0) and changed the NPC speed but the frequency of how often, NOT fast, they move looks weird and I'm trying to find where the code is in the source for movement.
>
> So basically I want the movement to be more fluid rather than jerky.
>
>  
>
> Also, I'm planning to add a scrl bar to judge what the frequency is, don't think that will change anything though.

Frequency is in ModServerLoop
Link to comment
Share on other sites

NPC movement is handled in Sub UpdateMapLogic,

Sub UpdateMapLogic is called from Sub ServerLoop in ModGameLogic

I believe by EO2 and EO3 it's called every 1000 ticks. So where it says tmr1000 < GetTickCount you should find it saying "Call UpdateMapLogic"

You'll see below where it says tmr1000 = GetTickCount + 1000.  This number is where you decide how often it's called. You could comment it out from here and create a brand new timer to as I think tmr1000 also calls other functions, so you'd simply want to remove the UpdateMapLogic from within the nested if statement for tmr1000 and then add this

dim tmrUpdateMap as long

if tmrUpdateMap < GetTickCount

Call UpdateMapLogic

tmrUpdateMap = GetTickCount + 500

end if

that number, 500 (500ms) lets you decide the frequency.
Link to comment
Share on other sites

To an optimist freak like me, i don't like increasing the speed in which other things move, it only creates more stress on the cpu(albeit very little but if you know me, i hate that shiz so much), i'll try and make a tutorial on how to accomplish this with a bit better optimized way of doing it.
Link to comment
Share on other sites

> If this were 1998, I'd be concerned haha!
>
>  
>
> But any tutorial would be beneficial to users here trying to learn! :)

haha yea, specs nowadays can handle the server and client like nothing, but i still like to keep a fixed mind of "i wanna try and make this engine as optimized as i can!" lol but yea, i'm going to try and make a tutorial on how to make the npc movement a bit more smoother to kind of allow for that constant walking feeling.
Link to comment
Share on other sites

  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...