• What are you working on? v19
    6,590 replies, posted
[QUOTE=danharibo;31387482]Or something along the lines of a velocity packet, so you only have to tell clients about when an entity's speed changes, not when it moves.[/QUOTE] You'll have to send their positions occasionally, because unless everything starts at exactly the same state and all the time updates are perfect, something will go out of line.
[QUOTE=Map in a box;31385144]Every half second is pretty fast.[/QUOTE] I don't know the type of game he is developing, but for source engine server the default update rate is 20 snapshot/s . Source : [url]http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking[/url] It's a good article about game networking.
[QUOTE=Cyril;31388919]I don't know the type of game he is developing, but for source engine server the default update rate is 20 snapshot/s . Source : [url]http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking[/url] It's a good article about game networking.[/QUOTE] Source has a lot more stuff to do than his game, so he has less he needs to keep perfectly sync.
Wah, I'm doing a bit of C++ work again temporarily, its' really weird doing it again after using C# for so long.
Anyone have any clues about how to remotely render a screenshot of a fullscreen game? I've been messing with some IDirect3DDevice hooks but not getting very far with it.
Every half second isn't fast all, that's actually pretty slow if it's an action-based game.. In fact, that's terribly slow. Most action games send/receive data at at least 10 or 20 FPS, and you think 2 FPS is too much? Jeeze. Then again, he did say it was grid-based, right? In which case I'd just send packets whenever the character moves instead of on a tick-based system.
[QUOTE=Gbps;31389894]Anyone have any clues about how to remotely render a screenshot of a fullscreen game? I've been messing with some IDirect3DDevice hooks but not getting very far with it.[/QUOTE] What is your goal? If I understood it correctly you want to trigger a snapshot of the directX framebuffer to be captured over the network, perhaps something like certain anti-cheat systems? If that's the case this should be possible by hooking the device::present function and running your own code to capture the framebuffer when signaled to do so. If I can find it and I recall correctly, I possibly have some rather old code that could help with hooking and capturing an image from a directX 9 device.
[QUOTE=bean_xp;31390303]What is your goal? If I understood it correctly you want to trigger a snapshot of the directX framebuffer to be captured over the network, perhaps something like certain anti-cheat systems? If that's the case this should be possible by hooking the device::present function and running your own code to capture the framebuffer when signaled to do so. If I can find it and I recall correctly, I possibly have some rather old code that could help with hooking and capturing an image from a directX 9 device.[/QUOTE] nonono not over a network. I mean remotely as in from another process. It's for my screenshot project, and I'm sort of stuck at actually capturing the framebuffer (I have no previous experience in Direct3D, I'm just working off of example code basically). The hooking part isn't a problem for me though.
[QUOTE=Gbps;31390523]nonono not over a network. I mean remotely as in from another process. It's for my screenshot project, and I'm sort of stuck at actually capturing the framebuffer (I have no previous experience in Direct3D, I'm just working off of example code basically). The hooking part isn't a problem for me though.[/QUOTE] Inject a dll and capture the current device then you can get the data in the buffer using directx functions.
[QUOTE=Gbps;31390523]nonono not over a network. I mean remotely as in from another process. It's for my screenshot project, and I'm sort of stuck at actually capturing the framebuffer (I have no previous experience in Direct3D, I'm just working off of example code basically). The hooking part isn't a problem for me though.[/QUOTE] Ah ok, well looking back through my old code I found this which grabs the front buffer and saves to an image file. [cpp] IDirect3DSurface9 * frontbuffer; device->CreateOffscreenPlainSurface(width, height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &frontbuffer, NULL); device->GetFrontBufferData(NULL, frontbuffer); D3DXSaveSurfaceToFileA(filename, D3DXIFF_PNG, frontbuffer, NULL, NULL);[/cpp] If you do this within the device::present function hook it should work. There are 2 things you need to watch out for as far as I'm aware. Firstly you need to know the width and height of the front buffer ahead of capture, which you should be able to obtain using the GetSystemMetrics function of the windows API. Secondly in windowed mode the front buffer is actually the full screen, desktop included. The last argument of D3DXSaveSurfaceToFile is a rectangle which specifies the sub-rectangle to save. If you find the size and position of the window you can create this rectangle. [B]Edit[/B]: Don't forget frontbuffer->Release() after saving
[QUOTE=bean_xp;31390771]Ah ok, well looking back through my old code I found this which grabs the front buffer and saves to an image file. [cpp] IDirect3DSurface9 * frontbuffer; device->CreateOffscreenPlainSurface(width, height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &frontbuffer, NULL); device->GetFrontBufferData(NULL, frontbuffer); D3DXSaveSurfaceToFileA(filename, D3DXIFF_PNG, frontbuffer, NULL, NULL);[/cpp] If you do this within the device::present function hook it should work. There are 2 things you need to watch out for as far as I'm aware. Firstly you need to know the width and height of the front buffer ahead of capture, which you should be able to obtain using the GetSystemMetrics function of the windows API. Secondly in windowed mode the front buffer is actually the full screen, desktop included. The last argument of D3DXSaveSurfaceToFile is a rectangle which specifies the sub-rectangle to save. If you find the size and position of the window you can create this rectangle.[/QUOTE] Thanks for the info! I'll try it out and see what I can come up with.
I created a rainbow today. [img]http://cold.netburst.co.uk/file/SS-2011-07-28_22.16.47.png[/img]
ugly however cracked however
Friend promised me Humble Bundle 3 if I made the browser scrollbar for Rimshot (Which he actually uses, hooray), so I did that. [img]http://i.imgur.com/zYpgu.png[/img] He did not deliver. Though I didn't expect him to, anyway. The missing scrollbar had been annoying me for quite a while now so that's okay. Programming scrollbars is serious business. Especially when the amount of entries can change and you have to adjust the scrollbar position and everything.
[QUOTE=Maurice;31392411]Friend promised me Humble Bundle 3 if I made the browser scrollbar for Rimshot (Which he actually uses, hooray), so I did that. [img]http://i.imgur.com/zYpgu.png[/img] He did not deliver. Though I didn't expect him to, anyway. The missing scrollbar had been annoying me for quite a while now so that's okay. Programming scrollbars is serious business. Especially when the amount of entries can change and you have to adjust the scrollbar position and everything.[/QUOTE] You know the Humble Bundle 3 is basically free right?
[QUOTE=ColdFusionV2;31392487]You know the Humble Bundle 3 is basically free right?[/QUOTE] I wouldn't pay less than $10 and I'm not very liquid right now. (Is that a figure of speech that exists in English?) [url]http://en.wikipedia.org/wiki/Liquidity[/url]
[QUOTE=Maurice;31392539]Is that a figure of speech that exists in English?[/QUOTE] Not really.. It's probably better to say you don't have much spare cash / say you're broke
[QUOTE=Maurice;31392539]I wouldn't pay less than $10 and I'm not very liquid right now. (Is that a figure of speech that exists in English?) [url]http://en.wikipedia.org/wiki/Liquidity[/url][/QUOTE] Not in that context, you would only use the term liquidity in business speak
Also technically liquidity means the possibility to exchange assets for money, doesn't it?
It's common speech - if you know what he meant, it's correct. :v:
[QUOTE=Maurice;31392539]I wouldn't pay less than $10 and I'm not very liquid right now. (Is that a figure of speech that exists in English?) [url]http://en.wikipedia.org/wiki/Liquidity[/url][/QUOTE] If you PM me your email address I'll buy it for you. At $10 if you really want.
[QUOTE=ColdFusionV2;31392487]You know the Humble Bundle 3 is basically free right?[/QUOTE] Only if you're an asshole.
[thumb]http://i.imgur.com/hzAef.png[/thumb] Recoded my server and client so things are a bit smoother. I've ran into problems though, like how this one guy manages to be able to control me whenever he joins after me.. And of course players getting stuck in that god damn green box all the time. Not to mention sometimes when they join it screws up on their side. Otherwise, I've improved things such as movement, and made a basic item simulator :v: holy shit large image
I'm off on holiday for a week with probably no internet connection. I plan to finish an Android version of a flash game I made a few years ago (Pirate Launch) while I'm there. See you all in a week!
WCF + Mysql + Json = awwwwwyaaaaa Right now the WCF service is sitting at 0.7% cpu usage with 300 users. So glad I switched from php.
My tower defense game is coming along nicely. I have working debuffs (but I call them buffs) such as damage over time or slow down. [media]http://www.youtube.com/watch?v=x_YpcqGRLb0[/media]
Seeing as making a star ruler mod probably doesnt quite count as programming over here, ill probably be completely absent for a little while while i go about completely ruining the game and all its scripts, and ill try and think of a (programming) surprise for when i come back :v:
Is there any easy way to get the rendered width of a SFML string? I can't find it in the documentation.
[QUOTE=Dehodson;31400189]Is there any easy way to get the rendered width of a SFML string? I can't find it in the documentation.[/QUOTE] -snip there is a much better method below me-
[QUOTE=Dehodson;31400189]Is there any easy way to get the rendered width of a SFML string? I can't find it in the documentation.[/QUOTE] Assuming your usiing 2.0 it would be sf::Text.GetRect().width
Sorry, you need to Log In to post a reply to this thread.