[QUOTE=NovembrDobby;29086576]Does anyone know how to do raw mouse input in C#? I've been having problems with centering the mouse all the time recently.[/QUOTE]
Also, is there a way to do it and still keep it multi-platform?
[editline]10th April 2011[/editline]
[QUOTE=Jallen;29086722]So many people don't know about fixed timesteps. They are easy to implement and 100x better so they should really be the norm for framerate independent game logic by now.[/QUOTE]
I think I understand how it works but I'm not sure.
Basically, how I see it is:
Render/sleep/do stuff to pass the time and measure how much time it passed since the last update. Then, while that time is above 1/60, update and reduce the total time by 1/60 per update.
[QUOTE=Darwin226;29086805]Also, is there a way to do it and still keep it multi-platform?
[editline]10th April 2011[/editline]
I think I understand how it works but I'm not sure.
Basically, how I see it is:
Render/sleep/do stuff to pass the time and measure how much time it passed since the last update. Then, while that time is above 1/60, update and reduce the total time by 1/60 per update.[/QUOTE]
It's more like (considering this is in your loop)
- check elapsed time, add it to the accumulator
- if accumulator < the timestep do nothing
- if accumulator > the timestep then run the update [elapsed time / timestep] times (integer division) and put [elapsed time % timestep] in the accumulator
- render
[editline]10th April 2011[/editline]
[QUOTE=ColdFusion;29086766]The problem is that it doesn't work in multiplayer games.[/QUOTE]
You're going to have to explain why, because I see no problem whatsoever in using a fixed timestep for an online game.
[QUOTE=Jallen;29087212]It's more like (considering this is in your loop)
- check elapsed time, add it to the accumulator
- if accumulator < the timestep do nothing
- if accumulator > the timestep then run the update [elapsed time / timestep] times (integer division) and put [elapsed time % timestep] in the accumulator
- render
[editline]10th April 2011[/editline]
You're going to have to explain why, because I see no problem whatsoever in using a fixed timestep for an online game.[/QUOTE]
Oh, I remember you saying you should render as fast as you can and update once you're above 1/framelock.
But rendering once per update makes sense, yes.
In my game, I have an FPS max on (say about 40, it's only a 2D game where FPS isn't so important) - so each frame has a max of 25ms to update (run physics tick and then render). If the actual frame takes, say, 1ms to update, then it will sleep for 24ms and run the next frame. I tell my physics engine to step at 25ms each time, regardless of how long the frame actually takes to update - if the frame takes longer than 25ms to update, then it's either a freeze in the system (like minimising the window, or the OS loading something or something) and the physics won't glitch massively when normal FPS is restored (like Dlaor's ball-flying-through-laser exploit) but simply tick along a 25ms frame like nothing ever happened - which is what you'd expect.
If the frames constantly take longer than 25ms to run, like you're trying to run it on a REALLY old PC, then the simulation will slow down and lag - but I don't care about trying to make my game work on PCs with 100Mhz processors and 32mb of ram.
[editline]10th April 2011[/editline]
[QUOTE=Darwin226;29087280]Oh, I remember you saying you should render as fast as you can and update once you're above 1/framelock.
But rendering once per update makes sense, yes.[/QUOTE]
Rendering faster than updating is pointless, because you're just gonna end up rendering the same frame twice - which is a waste of CPU.
[QUOTE=Darwin226;29087280]Oh, I remember you saying you should render as fast as you can and update once you're above 1/framelock.
But rendering once per update makes sense, yes.[/QUOTE]
Well you do render as fast as you can in the steps I said.
You could render only once per update but there are also methods of interpolation between updates which stop temporal aliasing, so you wouldn't be able to do it in that situation. (temporal aliasing is an effect of the frametime not matching up well with the timestep that causes the occasional 2 update visual skip)
[editline]10th April 2011[/editline]
[QUOTE=thomasfn;29087302]In my game, I have an FPS max on (say about 40, it's only a 2D game where FPS isn't so important) - so each frame has a max of 25ms to update (run physics tick and then render). If the actual frame takes, say, 1ms to update, then it will sleep for 24ms and run the next frame. I tell my physics engine to step at 25ms each time, regardless of how long the frame actually takes to update - if the frame takes longer than 25ms to update, then it's either a freeze in the system (like minimising the window, or the OS loading something or something) and the physics won't glitch massively when normal FPS is restored (like Dlaor's ball-flying-through-laser exploit) but simply tick along a 25ms frame like nothing ever happened - which is what you'd expect.
If the frames constantly take longer than 25ms to run, like you're trying to run it on a REALLY old PC, then the simulation will slow down and lag - but I don't care about trying to make my game work on PCs with 100Mhz processors and 32mb of ram.
[editline]10th April 2011[/editline]
Rendering faster than updating is pointless, because you're just gonna end up rendering the same frame twice - which is a waste of CPU.[/QUOTE]
See my response to darwin.
Also you are forgetting things which won't be dependent on the updates. Visual effects (like fades) which need to be smooth but not accurate may take place using a variable timestep outside of the update function.
Is there a way to get IntelliSense with runtime-compiled files in Visual Studio?
[QUOTE=Darwin226;29087561]Is there a way to get IntelliSense with runtime-compiled files in Visual Studio?[/QUOTE]
I ended up creating a separate project for them, which required the executable for the main project but was set to not compile but to just copy across to where I wanted my scripting files to be.
If you use a SemiFixed(or fixed) timestep in multiplayer game certain players will be running faster/slower as others?(At certain moments) You can't expect all players to run at the Speed of the SemiFixed timestep.
[QUOTE=ColdFusion;29087667]If you use a SemiFixed(or fixed) timestep in multiplayer game certain players will be running faster/slower as others?(At certain moments) You can't expect all players to run at the Speed of the SemiFixed timestep.[/QUOTE]
You could have the physics simulation happen on the server.
Well, players that have slower computers that can't keep up with the update will have input lag with any timestep method.
For others, the server should make sure that they don't try to move more times than they're allowed to.
[img]http://i.cubeupload.com/9roYRq.png[/img]
Inspired by [url]http://www.falstad.com/circuit/[/url] but all my own code.
Considering I've been using Java for like two weeks I think I'm doing pretty good.
[QUOTE=NovembrDobby;29086576]Does anyone know how to do raw mouse input in C#? I've been having problems with centering the mouse all the time recently.[/QUOTE]
At least the SVN version of OpenTK provides raw input with [url=http://www.opentk.com/doc/input]OpenTK.Input.Mouse[/url]
I seem to remember a while ago someone posted a sprite of the Xbox 360 buttons.
Does anyone still have it, or something similar?
Thanks
[IMG]http://i225.photobucket.com/albums/dd159/samuka97/remindmenewfontstringwrap.png[/IMG]
Friggen' fraggin' string wrap always fails me :saddowns:
[editline]10th April 2011[/editline]
I think I'm gonna resort to use the same system Minecraft uses for limiting characters on a sign post so the descriptions don't look so shit
[QUOTE=Shrapnel :3;29067816]Any particularly good article you could link, would be very useful. :)[/QUOTE]
Nah most of them are either too complex ( at least for me and my small lazy mind ) or just don't explain at all.
I'll write one if you want =]
[QUOTE=Ortzinator;29070188]Is that the newfangled pathfinding Supreme Commander 2 uses?[/QUOTE]
Yep, except that theirs is overoptimized and [u][url=http://www.rageeffect.com/post/982193331/supcom-2-flowfield-pathfinding]fails critically in certain conditions[/url][/u]
[QUOTE=CarlBooth;29088765]I seem to remember a while ago someone posted a sprite of the Xbox 360 buttons.
Does anyone still have it, or something similar?
Thanks[/QUOTE]
[url]http://create.msdn.com/en-US/education/catalog/utility/controller_buttons[/url]
Correct me if im wrong but the Ms-PL is basically the same as the ZLib licence right?
As in "Use it as you want, dont claim you created it and dont hold us responsible if you blow up the world with it" so you can use it in commercial projects?
[QUOTE=CarlBooth;29088765]I seem to remember a while ago someone posted a sprite of the Xbox 360 buttons.
Does anyone still have it, or something similar?
Thanks[/QUOTE]
I have the [url=http://i.imgur.com/EgCLs.png]top[/url]/[url=http://i.imgur.com/hOhUI.png]front[/url] images of the controller if that helps?
edit: :saddowns:
[QUOTE=Richy19;29089115][url]http://create.msdn.com/en-US/education/catalog/utility/controller_buttons[/url]
Correct me if im wrong but the Ms-PL is basically the same as the ZLib licence right?
As in "Use it as you want, dont claim you created it and dont hold us responsible if you blow up the world with it" so you can use it in commercial projects?[/QUOTE]
That's what I'm using at the moment, but the buttons are really dark.
Someone posted a nice one a few months ago.
nice blog
[QUOTE=TVC;29085331]Been trying to hook Winsock 2 functions so I can try and figure out the Fallen Earth network protocol, have had some success, but as soon as I hook it freezes and just keeps sending the same packet over and over.
[media]http://www.tvcdev.net/files/img/Screenshot-2011-04-11_21.04.29.png[/media]
Media'd for largeness.
Help would be appreciated. :smile:[/QUOTE]
How that hooks anything is beyond me(you never specify 'send' anywhere, at least that I can see). Anyways I use DetourAttachEx instead of DetourAttach. Also I always liked v1.1 better so I created functions like
[cpp]LONG WINAPI DetourFunction(PVOID *ppPointer,
PVOID pDetour)
{
return DetourFunctionEx(ppPointer, pDetour, NULL, NULL, NULL);
}
LONG WINAPI DetourFunction(PVOID *ppPointer,
PVOID pDetour,
PDETOUR_TRAMPOLINE* ppRealTrampoline)
{
return DetourFunctionEx(ppPointer, pDetour, ppRealTrampoline, NULL, NULL);
}
LONG WINAPI DetourFunctionEx(PVOID *ppPointer,
PVOID pDetour,
PDETOUR_TRAMPOLINE *ppRealTrampoline,
PVOID *ppRealTarget,
PVOID *ppRealDetour)
{
LONG error = NO_ERROR;
if ((error = DetourTransactionBegin()) != NO_ERROR)
return error;
if ((error = DetourUpdateThread(GetCurrentThread())) != NO_ERROR)
return error;
if ((error = DetourAttachEx(ppPointer, pDetour, ppRealTrampoline, ppRealTarget, ppRealDetour)) != NO_ERROR)
return error;
if ((error = DetourTransactionCommit()) != NO_ERROR)
return error;
return NO_ERROR;
}
LONG WINAPI DetourRemove(PVOID *ppPointer,
PVOID pDetour,
BOOL remtramp)
{
LONG error = NO_ERROR;
if ((error = DetourTransactionBegin()) != NO_ERROR)
return error;
if ((error = DetourUpdateThread(GetCurrentThread())) != NO_ERROR)
return error;
if ((error = DetourDetach(ppPointer, pDetour, remtramp)) != NO_ERROR)
return error;
if ((error = DetourTransactionCommit()) != NO_ERROR)
return error;
return NO_ERROR;
}[/cpp]
What should I add to my incredibly crappy game? It looks like this now:
[img]http://img862.imageshack.us/img862/2319/collisiondetection20110.png[/img]
Player 1 can move, same as player2.
[QUOTE=Samuka97;29088857][img_thumb]http://i225.photobucket.com/albums/dd159/samuka97/remindmenewfontstringwrap.png[/img_thumb]
Friggen' fraggin' string wrap always fails me :saddowns:
[editline]10th April 2011[/editline]
I think I'm gonna resort to use the same system Minecraft uses for limiting characters on a sign post so the descriptions don't look so shit[/QUOTE]
How did you manage to fuck the text up again? It's really blurry and strains my eyes.
[QUOTE=AGMadsAG;29089909]How did you manage to fuck the text up again? It's really blurry and strains my eyes.[/QUOTE]
That's Game Maker for ya. If you want sharp and clear text, don't use Game Maker.
[QUOTE=AGMadsAG;29089909]How did you manage to fuck the text up again? It's really blurry and strains my eyes.[/QUOTE]
I'm not sure :saddowns:
But wait, are you talking about the one on the left, right or both?
Get rid of the shadow, use a standard sans serif font like Myriad Pro or Tahoma
Why do you need to limit the length of task names?
Also, are you using WPF? If so, what version?
[QUOTE=Samuka97;29090283][img_thumb]http://i225.photobucket.com/albums/dd159/samuka97/remindmeevennewerfont.png[/img_thumb][/QUOTE]
Limit task names? Whoa. Don't do that.
Edit: Ninja.
I'm trying to make a RTS-ish game via a 2D tile engine and I'm unsure of how to define buildings which span more than one tile. Any ideas?
[url]http://spec.jimbomcb.net/v2/[/url] this is what I have been working on. Should I be posting this stuff in the web development forum instead? I prefer this place, the other one just seems to be people showing off website designs, not stuff like this.
Sorry, you need to Log In to post a reply to this thread.