SA-MP Forum
November 21, 2009, 12:33:11 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hosted tab listings available from serverFFS
 
   Home   Help Login Register  
Pages: [1] 2 3
  Print  
Author Topic: Pool game  (Read 1372 times)
niCe
Big Clucker
**
Posts: 61


View Profile WWW
« on: November 03, 2009, 10:18:23 am »

Has anyone ever made a pool game for SA-MP? I've managed to create one, but in fact, I'm affraid it will lag server - it uses 20ms timer and counts 15+1 balls positions and vectors collisions - on first sight, there are no lags, but I don't really think this is good solution, however, I can't think of another one. If anyone has some experience, please let me know, I wanna compare someone's other pool game attempt. I wonder if using OnObjectMoved would load the server a bit less than that timer.

Screenshot just for preview

Logged

Fortes fortuna adiuvat - Terence

Pool game in SA-MP! http://www.youtube.com/watch?v=TkT52Lk-PcY&feature=player_embedded
More information about game mode: http://forum.sa-mp.com/index.php?topic=131553.0
Emilio [Temp Acc]
Little Clucker
*
Posts: 21


View Profile
« Reply #1 on: November 03, 2009, 10:27:05 am »

Just gotta say that it looks completely awesome!
Logged




Quote from: SAMP Wiki
This page was last modified 13:37, 13 September 2009

Forgot the password for my old account, using my brothers.
MX_Master
Big Clucker
**
Posts: 116



View Profile WWW
« Reply #2 on: November 03, 2009, 10:33:09 am »

i see just animation, right?
Logged


Russian Scripter, MX GAMES, Kazakhstan



clum'
Huge Clucker
***
Posts: 243


View Profile
« Reply #3 on: November 03, 2009, 12:07:42 pm »

Depends on many things, how much bandwidth your server has, your server hardware specs. How many players are in your server, etc. Just try the script out and see if it causes any problems.
Logged
niCe
Big Clucker
**
Posts: 61


View Profile WWW
« Reply #4 on: November 03, 2009, 12:10:42 pm »

i see just animation, right?


No, it's no scam, it's real
Welcome to Los Santos - PoolgameDQ | by Aeva


Depends on many things, how much bandwidth your server has, your server hardware specs. How many players are in your server, etc. Just try the script out and see if it causes any problems.

Yes, but generally, is it good idea to use 20ms timer? I also tried that callback OnObjectMoved but it handled just 6+1 balls, when I added 15+1, it simply "frozen" the server - maybe that callback has been called too much times and server wasn't able to handle that load.
« Last Edit: November 03, 2009, 12:22:17 pm by niCe » Logged

Fortes fortuna adiuvat - Terence

Pool game in SA-MP! http://www.youtube.com/watch?v=TkT52Lk-PcY&feature=player_embedded
More information about game mode: http://forum.sa-mp.com/index.php?topic=131553.0
Shady91
High-roller
*****
Posts: 1334



View Profile WWW
« Reply #5 on: November 03, 2009, 12:22:25 pm »

this is pritty neat mate Wink
Logged

[FS] Filterscripts

[FS] Police Gates & Compound
[FS] Moving Text Draw
[FS] Weed System
[FW-RP] Free World Role Play                  

[FW-RP] Music                 
Misc.                               

[MISC] How long I have to live
67.159.63.28:7778
$€ЯĢ
Gangsta
****
Posts: 935



View Profile
« Reply #6 on: November 03, 2009, 12:28:03 pm »

Just wow  Shocked

Awesome.
Logged


$€ЯĢ recommends:
ZCMD (by ZeeX) - the fastest & the simplest command processor
Sscanf (by Y_Less) - the easiest way of splitting
foreach (by Y_Less) - the fastest & the most efficient loops
Streamer Plugin (by Incognito) - the most perfect & the fastest all-in-one streamer
MySQL Plugin R2 (by G-sTyLeZzZ) - the only fully working way to replace slow files
radhakr
Big Clucker
**
Posts: 66


View Profile WWW
« Reply #7 on: November 03, 2009, 01:23:58 pm »

Wow, really impressive. Good work.

Edit: After playing the server, all I can say is AWESOME.
« Last Edit: November 03, 2009, 02:38:05 pm by radhakr » Logged

OddBaLL
Little Clucker
*
Posts: 23



View Profile
« Reply #8 on: November 03, 2009, 01:58:58 pm »

Would be fun!  Cool
Logged


roby65
Huge Clucker
***
Posts: 227


View Profile
« Reply #9 on: November 03, 2009, 10:43:41 pm »

This is just awesome, the coolest thing i've ever seen on samp  Wink

Some suggestions:
A 20 ms timer is a lot of work for the server. Let's say that a object is 16 byte (x+y+z+ID), in 1 second it is fired 50 times so it is a 800 byte load for every ball.
With 15+1 balls.... 12,8 kb/s for every player for the server.
It's a LOT!
So try to do this:
1)Update only the balls that need update (the ones that are moving)
2)I think that you can use a 50 ms timer
3)Let more the client move the objects, cause i think it can predict movements by itself

 Wink
Logged
zєяσмαиѕтєя
Huge Clucker
***
Posts: 337



View Profile
« Reply #10 on: November 04, 2009, 05:46:58 am »

Awesome. Shocked Shocked Shocked

Release ? afro
Logged

-
Guedes_
High-roller
*****
Posts: 1369



View Profile WWW
« Reply #11 on: November 04, 2009, 05:56:13 am »

You have allready showed us it on a previous post... are you gonna release it? or just keep saying you have done it? :\
Logged

My Website (includes mods for GTAU:MP, SAMP 0.3 and .MAP files):

                                          

                                           SAMP 0.3 Themes & Cursors


(Click on the userbars and green text above to view my work)



Mive
Huge Clucker
***
Posts: 253



View Profile WWW
« Reply #12 on: November 04, 2009, 06:28:22 am »

That's awesome  Shocked
Logged

My Maps:                                                            
[MAP] Dumpster                                                           [MAP] Crashed Truck Newest             
[MAP] Improved Store                                                                                                                          
[MAP] Las Venturas Prison
[MAP] Improved Construction Site


Daybreakers Vampire Movie   -    Legion   -   Avatar    -    Salt
Javi_Cogollero
Little Clucker
*
Posts: 39


View Profile WWW
« Reply #13 on: November 04, 2009, 06:36:27 am »

Link!!!!!! Sad
Logged

I am Spanish and do not write English.
Sorry for bad speak english.
Use the Google Translator.
niCe
Big Clucker
**
Posts: 61


View Profile WWW
« Reply #14 on: November 04, 2009, 07:49:57 am »

Thanks everyone, I'm pleased you like it.

This is just awesome, the coolest thing i've ever seen on samp  Wink

Some suggestions:
A 20 ms timer is a lot of work for the server. Let's say that a object is 16 byte (x+y+z+ID), in 1 second it is fired 50 times so it is a 800 byte load for every ball.
With 15+1 balls.... 12,8 kb/s for every player for the server.
It's a LOT!
So try to do this:
1)Update only the balls that need update (the ones that are moving)
2)I think that you can use a 50 ms timer
3)Let more the client move the objects, cause i think it can predict movements by itself

 Wink

Well, the data is not being sent to every player, is it? If yes, then this is a problem... I didn't even thought of this matter, it's a good point though.
1. I just optimalised a script a bit to calculate only neccessary datas
2. I tried 50ms timer, it works fine, but it rarely happens one cue ball goes through another one. It is good solution for the server, anyway, the experience from that game is lower.
3. Please how you exactly mean client move? When a client will move an object, server may not get its position then, so if I understand well what you have written, it can't be done.

It seems there is no better solution than that timer though. I've tried OnObjectMoved, but looks like it's being called even more often, when I move objects to 0.2points distance and recalculate then collisions in that callback. I think callback would be better solution, but for unknown reason, it simply freezes the server when it has to calculate 15+1 balls (upon first turn naturally all 16 balls collisions are being processed). So I'm a way confused.
« Last Edit: November 04, 2009, 07:58:06 am by niCe » Logged

Fortes fortuna adiuvat - Terence

Pool game in SA-MP! http://www.youtube.com/watch?v=TkT52Lk-PcY&feature=player_embedded
More information about game mode: http://forum.sa-mp.com/index.php?topic=131553.0
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF one | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!