Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, SBGuy, TipmyPip, ozgur), 859 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Sending a BMP or a TGA file #116262
03/10/07 09:50
03/10/07 09:50
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hi!
I would like all the players to have the option creating their own logo, and use this logo in a multiplayer game.

If you've played X˛ - the Thread, you might remember the logo that is attached to the ship. You can create your own logo and save it into a folder, and then choose this logo to be displayed on your ship.
We'll worry about putting the ship logo on the ship later on, maybe by manipulating the skins or just using a sprite.

For now, we're trying to figure out how to send the image - automatically - over the net, so that when I make my own logo on my computer, it can be displayed on all other computers as well.
Also, is there a way to make things safer? I certainly don't want any viruses to be send over the net...

I don't know too much about sending files/network outside 3dgs...

Thanks,
Micha

P.S. we're using populace. Shouldn't really matter... but just in case you need to know.
I also have the GSHTTP.dll, which should be able to download the file...?


~"I never let school interfere with my education"~
-Mark Twain
Re: Sending a BMP or a TGA file [Re: Germanunkol] #116263
03/10/07 18:12
03/10/07 18:12
Joined: Jun 2005
Posts: 130
K
khanoftruth Offline
Member
khanoftruth  Offline
Member
K

Joined: Jun 2005
Posts: 130
This would only work if you have users and stuff (I think). My method applies to using PHP and MySQL.

Think about how when a user creates their username, it send that data to the MySQL database on the server. The same process (I don't really know it off the top of my head) would apply here.


The Galvanic Productions Hompage: www.GalvanicProductions.tk For our current project, click on the Nirvana link.
Re: Sending a BMP or a TGA file [Re: khanoftruth] #116264
03/10/07 19:39
03/10/07 19:39
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Custom user content is a logistical nightmare if it's not built as part of the network architecture (which it isn't in 3DGS).

You could enact a solution that uploaded the custom logo to a web server and then asked each player to download it when needed in the game but I think it would be a nightmare to script out, manage, and implement properly.

Furthermore everytime the logo changed or a new player came on board you would have to re-upload and re-download and that could eat up your bandwidth right quick if you don't manage it properly.

My opinion: Can be done but I daresay it would be the only thing one person would be working on for a long time to get it done.

Re: Sending a BMP or a TGA file [Re: fastlane69] #116265
03/11/07 12:33
03/11/07 12:33
Joined: Aug 2005
Posts: 343
Germany
HPW Offline
Senior Member
HPW  Offline
Senior Member

Joined: Aug 2005
Posts: 343
Germany
You could try to open the images with file_open_read and read the content into a String, then send the string to a 3DGS Server application and save it as a file with str_open_write. If clients connects to the server than you could send the image in the same way to the clients.
Viruses are really a problem, but without a implementet virus search engine in 3DGS you can't really be sure to avoid them.


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Sending a BMP or a TGA file [Re: HPW] #116266
03/11/07 13:15
03/11/07 13:15
Joined: Oct 2004
Posts: 290
Latvia
Leonardo Offline
Member
Leonardo  Offline
Member

Joined: Oct 2004
Posts: 290
Latvia
I'm not sure how to send a 200x200 image or larger, but I've played MU Online and there you can create your own custom guild logo, that is 9x9 pixels I believe or something like that. If that would suit me, I would create a large grid where one square represents one pixel and then let the user create his logo pixel by pixel and send that information to the server and then draw the pixels on the skin of a ship, human etc. But if you need large bitmaps, this option would not be very useful.


"Things of the mind left untested by the senses are useless."
Re: Sending a BMP or a TGA file [Re: Leonardo] #116267
03/11/07 13:20
03/11/07 13:20
Joined: Aug 2005
Posts: 343
Germany
HPW Offline
Senior Member
HPW  Offline
Senior Member

Joined: Aug 2005
Posts: 343
Germany
If you can import an bitmap into the "pixel-editor" like Leonardo wrote, than you can also be more sure to avoid viruses. You only send then 3 or 4 arrays to the server and the clients, like array_red[512], array_green[512], array_blue[512], array_alpha[512].

Last edited by HPW; 03/11/07 13:21.

Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Sending a BMP or a TGA file [Re: Leonardo] #116268
03/11/07 13:23
03/11/07 13:23
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Reading and sending the file in C-Script should not work, because C-Script uses formatet reading afaik. But it's possible in C++ via the ios::binary flag, search in good for fstream.

If it's not like a said and C-Script gets the bits unchanged, this should easly be possible. Just do like HPW told you, open the file, read it into a string and send the string. At the other clients, create a black bitmap and write the data to it.

Re: Sending a BMP or a TGA file [Re: TWO] #116269
03/11/07 13:32
03/11/07 13:32
Joined: Aug 2005
Posts: 343
Germany
HPW Offline
Senior Member
HPW  Offline
Senior Member

Joined: Aug 2005
Posts: 343
Germany
It is also possible with sending the arrays (red, green, blue and alpha) and use the draw or bitmap methods of 3DGS. You could use draw_line with only 1 pixel length of the line for each pixel or use pixel_to_bmap for this.


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Sending a BMP or a TGA file [Re: Germanunkol] #116270
03/12/07 02:27
03/12/07 02:27
Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
Nagashi Offline
Member
Nagashi  Offline
Member

Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
The basics of this are quite simple with gshttp.dll I’ve constructed a small demo here… http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/719567/an/0/page/0#Post719567 it’s basically the meat and potatoes of what your looking for, note that this demo only covers the downloading and loading in-game during play, not the uploading…

Cheers


No rest for the wicked.
__________________________

Ironbound Studios
__________________________
Re: Sending a BMP or a TGA file [Re: Nagashi] #116271
03/12/07 12:33
03/12/07 12:33
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
you guys rule. Thanks for every single answer

I'll fiddle around with this, and maybe host the code afterwards, if I get something working.
Thanks!!

Micha


~"I never let school interfere with my education"~
-Mark Twain
Page 1 of 2 1 2

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