Mohenjo Daro Posted October 11, 2014 Author Share Posted October 11, 2014 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 More sharing options...
SkywardRiver Posted October 11, 2014 Share Posted October 11, 2014 > 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 More sharing options...
Mohenjo Daro Posted October 11, 2014 Author Share Posted October 11, 2014 > Frequency is in ModServerLoopYes, but what is it called? Link to comment Share on other sites More sharing options...
SkywardRiver Posted October 11, 2014 Share Posted October 11, 2014 I think it's somewhere in UpdateMapLogic. I'm just going off the top of my head right now though, so don't take my word for it 100% Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted October 11, 2014 Author Share Posted October 11, 2014 Well, I've found that area but still don't know what to look for, the ' Check to see if Npc can move  or whatever didn't help Link to comment Share on other sites More sharing options...
SkywardRiver Posted October 11, 2014 Share Posted October 11, 2014 > Well, I've found that area but still don't know what to look for, the ' Check to see if Npc can move  or whatever didn't helpWell use common sense. Find where the call for UpdateMapLogic is located. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted October 11, 2014 Author Share Posted October 11, 2014 Yeah, I'm trying to use it. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted October 11, 2014 Author Share Posted October 11, 2014 Yeah, no, this isn't going well at all Link to comment Share on other sites More sharing options...
Rob Janes Posted October 11, 2014 Share Posted October 11, 2014 NPC movement is handled in Sub UpdateMapLogic,Sub UpdateMapLogic is called from Sub ServerLoop in ModGameLogicI 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 thisdim tmrUpdateMap as longif tmrUpdateMap < GetTickCountCall UpdateMapLogictmrUpdateMap = GetTickCount + 500end ifthat number, 500 (500ms) lets you decide the frequency. Link to comment Share on other sites More sharing options...
Growlith1223 Posted October 11, 2014 Share Posted October 11, 2014 Changing how fast the server updates the map logic isn't so great. you're not just increasing movement speed for the npc, you're updating EVERYTHING faster. Link to comment Share on other sites More sharing options...
SkywardRiver Posted October 12, 2014 Share Posted October 12, 2014 > Changing how fast the server updates the map logic isn't so great. you're not just increasing movement speed for the npc, you're updating EVERYTHING faster.This exactly. You'll have to rewrite how NPC movement is handled (maybe put it in it's own loop) for what you want. Link to comment Share on other sites More sharing options...
Rob Janes Posted October 12, 2014 Share Posted October 12, 2014 Unless you're competent in VB6 – this will be the only way to achieve what he wants to do. You could essentially create a new routine for handling NPC movement and call that from the Server Loop, but this would be for an experienced developer. Link to comment Share on other sites More sharing options...
Rob Janes Posted October 12, 2014 Share Posted October 12, 2014 And FYI the things affected by UpdateMapLogic are Item spawn rates, NPC AI (movement, attacking, regeneration), doors, and Hots/Dots Link to comment Share on other sites More sharing options...
Growlith1223 Posted October 12, 2014 Share Posted October 12, 2014 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 More sharing options...
Rob Janes Posted October 12, 2014 Share Posted October 12, 2014 If this were 1998, I'd be concerned haha!But any tutorial would be beneficial to users here trying to learn! :) Link to comment Share on other sites More sharing options...
Growlith1223 Posted October 12, 2014 Share Posted October 12, 2014 > 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 More sharing options...
Mohenjo Daro Posted October 12, 2014 Author Share Posted October 12, 2014 Thanks, Growl, I'll sit tight and wait for that, just let me know if you decide not to do the tut. But do you think you could use a scrl for it so that you can choose the smoothness? Link to comment Share on other sites More sharing options...
Growlith1223 Posted October 12, 2014 Share Posted October 12, 2014 Well the movement will be exactly like the player movement. so basically changing a timer will change the movement Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted October 12, 2014 Author Share Posted October 12, 2014 Alright, and that I can change :D Link to comment Share on other sites More sharing options...
aeronx Posted August 26, 2015 Share Posted August 26, 2015 Did anyone solve this already? thanks Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted August 26, 2015 Author Share Posted August 26, 2015 Well, I never figured it out cause I don't like messing with the server loop, but Grow figured it out I think Link to comment Share on other sites More sharing options...
aeronx Posted August 26, 2015 Share Posted August 26, 2015 Grow! show yourself and explain this to me please! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now