Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[ANET] Send BMAP to Players #294795
10/21/09 08:56
10/21/09 08:56
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Hi,

i tried different situations to draw in realtime on other pcīs via anet. That didnīt work very well so i decided to let the player paint as long as he holds "mouse left" if he stops holding the mouse button a screenshot is taken. Then a panel with a window is created which includes the screenshot.

That works very well on my own pc. But how can do it now that anet send this bmap to the other players?

The code is as follows:

Code:
BMAP* screenshot_bmap;

function paint()
{
   while(mouse_left)
   {
      //paintfunction
   }

   bmap_createblack(screenshot_bmap, 800, 600, 16);
   bmap_for_screen(screenshot_bmap, 1, 0);

   wait(3);

   // How to send "screenshot_bmap" to players now?
}

on_mouse_left = paint;



If i use a enet function and use cl_send function than all players create a screenshot of their own current engine picture.

Re: [ANET] Send BMAP to Players [Re: Rasch] #294817
10/21/09 12:23
10/21/09 12:23
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
The easiest way is to send the whole file, but this is only possible with ANet Pro.
What you can do with the free version is, that you read out all pixel colors and store it in an array. Then send the array and on the other participant you generate a bitmap with the colors of the array.

What was the problem with the realtime painting?


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANET] Send BMAP to Players [Re: Dark_samurai] #294826
10/21/09 13:13
10/21/09 13:13
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
I got the Standard Edition not the free one. The Problem was that the clients painted whenever another client pressed mosue left. and everyone painted on his own table.

I thought about the method of sending the bmap. But sending a 600x400 jpg file to 5 clients at the same time wouldnīt be the best performance.

Otherwise how would you send the whole file?

I thought about the array idea but never worked with arrays so how would i store the pixels in it?

THank you
Greetings laugh

Re: [ANET] Send BMAP to Players [Re: Rasch] #294836
10/21/09 13:37
10/21/09 13:37
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Quote:
The Problem was that the clients painted whenever another client pressed mosue left. and everyone painted on his own table.


Then you have a problem in your code. Something like that should be possible with ANet.

You will get the best performance with the realtime painting. Doing it with arrays is currently a bit complicated because a pixel has 3 components (red, green, blue) and you should use an array consisting of VECTORs. But sending such an array is currently not supported (although in the current Beta it is wink ).


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANET] Send BMAP to Players [Re: Dark_samurai] #294925
10/21/09 22:38
10/21/09 22:38
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I'd advice you to try realtime painting again, as well. If you want it to look like realtime painting, then sending the whole screen won't be a good idea. for one thing, clients running at different resolutions will be hard to handle, and, more importantly, sending an image file usually takes a few seconds, so you won't get a very fluid 'gameplay'. I use ANet for sending image files, and it works, but I wouldn't advice you to send it after every brushstroke. Instead, if you send the start and the end of a brushstroke, that's only (in theory) 4 values, if it's a straight line (x and y of startpoint, x and y of endpoint). That's a much faster way of sending, and the app will be much more fun to use. So, if I were you, I'd try again with that method.


~"I never let school interfere with my education"~
-Mark Twain

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1