![]() |
Replace Server Timers - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Replace Server Timers (/showthread.php?tid=813) |
Replace Server Timers - William - 09-03-2007 I dont know if this will speed up anything or slow it down. So please tell me if it dont and I remove the topic. This will replace the timers with a part of code in the game loop using TickCount. Server Side - This will replace the tmrSpawnMapItems. Go inside: Code: Sub GameAI() Code: Dim XTickCount(1 to 2) as Long, XFirst(1 to 2) as Byte Code: If XFirst(1) = 0 Then Server Side - This will replace the tmrPlayerSave. Go inside: Code: Sub GameAI() Code: If XFirst(2) = 0 Then The tmrShutdown is a little bit different, but Im tired so Im not gonna do that one. Follow Up If you want to add more timers into the gameloop. Change: Code: Dim XTickCount(1 to 2) as Long, XFirst(1 to 2) as Byte Code: Dim XTickCount(1 to 3) as Long, XFirst(1 to 3) as Byte Now in the bottom part of the Sub GameAI, you will add two new parts: Code: If XFirst(3) = 0 Then Now where it says "'Run the timer code here", that is the place were you put whats inside the timer. And thats it ![]() - Coke - 09-03-2007 The thing i have found with timers is they behave differently on different speeds of computer... at least thats what its like at college ~.~ - William - 09-03-2007 They should work independently i think, can't be sure thought. - Coke - 09-03-2007 I think its just a case of the pc's we use in class are just lagging so bad, its a pain in the arse since you make something and its timed perfectly then you go onto a normal pc and its hyperspeed -.- Re: Replace Server Timers - William - 10-06-2007 But the tick count should be reliable thought. So its probably better than using timers. Re: Replace Server Timers - Coke - 12-06-2007 William, does the login rely on any of these? Getting really :?'d off with 'connected sending login information...' freezes >. Re: Replace Server Timers - Rian - 12-06-2007 I'm looking into that right now, Fox. Have you tried this tut to see if it helps your problem? Re: Replace Server Timers - Robin - 12-06-2007 [quote="Fox"]William, does the login rely on any of these? Getting really :?'d off with 'connected sending login information...' freezes >. Re: Replace Server Timers - William - 14-06-2007 Updated a follow up. Re: Replace Server Timers - Coke - 14-06-2007 I converted the gameAI timer.. booted and noticed no npc's etc were moving... then realised that timers needed to run through the sub the tickcounts in lol. How would i work around this? Re: Replace Server Timers - William - 18-09-2007 Opss xD I forgot it should be: Private XTickCount(1 To 2) As Long, XFirst(1 To 2) As Byte If its just dimmed, it wont keep the variable after the sub is completed. |