SRL Archive - Game Development

attempt to make a game client with simba


MakIAM

2014-11-26 18:33:53

Hello everyone. My name is Make.
I am new here. but been a scar user since 3.13.
I was wondering if anyone had some knowledge of reading/loading resource files. "resource hacker .egf file" and/or sending/receiveng packet data "sockets and stuff" with simba to a game server.and/or settransbitmap on forms?
i am attempting a remake of a game Client in simba for a game server "Meow/kalandra/eoserv".
its a 2d RPG multi player type game.based from a game called Endless online.
I have alot of the main stuff remade form/buttons/screens/artwork but almost at a stand still with the project untill i figure a few things out.
few screenshots of the project as of today.
[ATTACH=CONFIG]24496[/ATTACH]
[ATTACH=CONFIG]24497[/ATTACH]

Cnc Welcome

KeepBotting

2014-11-26 19:00:09

Is it a Java applet? If so, you *might* be able to load it inside SMART.

Olly

2014-11-26 20:26:52

From: KeepBotting
Is it a Java applet? If so, you *might* be able to load it inside SMART.


Take a read…. again.

KeepBotting

2014-11-26 21:16:58

From: Olly
Take a read…. again.


Ouch, that was pretty bad.
I need to learn to read more than the title and first few words before I believe myself informed enough to formulate a response.

Thanks for catching me on that.

Incurable

2014-11-26 21:21:38

How many lines is that? Also, why not write it in C++/C#/Java/Python?

Daniel

2014-11-26 21:53:22

Check out Amethlion. :)

Similar to what you're doing.

Perhaps try to get into contact with solemn?

Looking forward to reading more about your project :D

MakIAM

2014-11-26 21:54:46

From: Incurable
How many lines is that? Also, why not write it in C++/C#/Java/Python?

in its current state 3170 lines. im hope to keep it under 10k lines.

i dont know c or c++Java/Python?
i havent coded anything in 25 years. back when you turned the pc on it just blinked….
pascals fine for me. got to start somewhere right?

thanks for the reply's

Incurable

2014-11-26 22:46:42

From: MakIAM
in its current state 3170 lines. im hope to keep it under 10k lines.

i dont know c or c++Java/Python?
i havent coded anything in 25 years. back when you turned the pc on it just blinked….
pascals fine for me. got to start somewhere right?

thanks for the reply's


Eh, fair enough… well, why not learn then? You seem to know what you're doing, so learning another language will be fairly simple. Python is similar enough to Pascal that you could probably pick it up in a few days. :)

akarigar

2014-11-27 00:55:59

Hey Make, here is some example code I whipped up related to "sockets and stuff." The comments should explain what is going on in the code itself.
Simple Client:

{$f-}

var socket: integer;
begin
// Create & connect our socket
socket = CreateSocket();
ConnectSocket(socket, 'localhost', '4040');

// Say hello, and get a reply
SendSocket(socket, 'Hello!');
writeLn(RecvSocket(socket));

// Say bye and get a reply
SendSocket(socket, 'bye');
writeLn(RecvSocket(socket));

// Clean up
CloseSocket(socket);
FreeSocket(socket);
end.
Simple Server:

{$f-}

var
serverSocket, clientSocket: integer;
input: string;
begin
// Create & bind our socket so we can accept connections
serverSocket := CreateSocket();
BindSocket(serverSocket, 'localhost', '4040');

// Wait for a socket to connect
ListenSocket(serverSocket);
clientSocket := AcceptSocket(serverSocket);

// Keep listening and responding until client says 'bye'
repeat
input := RecvSocket(clientSocket);
SendSocket(clientSocket, 'Server says: ' + input);
writeLn('from client: ', input);
until input = 'bye';

// Clean up
CloseSocket(clientSocket);
CloseSocket(serverSocket);
FreeSocket(clientSocket);
FreeSocket(serverSocket);
end.

As for the egf files, you can read and interpret them. Do you want examples on how to read from files in Simba? Interpreting the files will be challenging, if my limited understanding of Elmer Front is correct.

MakIAM

2014-11-27 02:23:26

From: akarigar
Hey Make, here is some example code I whipped up related to "sockets and stuff." The comments should explain what is going on in the code itself.
Simple Client:

{$f-}

var socket: integer;
begin
// Create & connect our socket
socket = CreateSocket();
ConnectSocket(socket, 'localhost', '4040');

// Say hello, and get a reply
SendSocket(socket, 'Hello!');
writeLn(RecvSocket(socket));

// Say bye and get a reply
SendSocket(socket, 'bye');
writeLn(RecvSocket(socket));

// Clean up
CloseSocket(socket);
FreeSocket(socket);
end.
Simple Server:

{$f-}

var
serverSocket, clientSocket: integer;
input: string;
begin
// Create & bind our socket so we can accept connections
serverSocket := CreateSocket();
BindSocket(serverSocket, 'localhost', '4040');

// Wait for a socket to connect
ListenSocket(serverSocket);
clientSocket := AcceptSocket(serverSocket);

// Keep listening and responding until client says 'bye'
repeat
input := RecvSocket(clientSocket);
SendSocket(clientSocket, 'Server says: ' + input);
writeLn('from client: ', input);
until input = 'bye';

// Clean up
CloseSocket(clientSocket);
CloseSocket(serverSocket);
FreeSocket(clientSocket);
FreeSocket(serverSocket);
end.

As for the egf files, you can read and interpret them. Do you want examples on how to read from files in Simba? Interpreting the files will be challenging, if my limited understanding of Elmer Front is correct.


Thank you very much for the examples. this is going to be very helpful.
this is for lape correct?
would the simba/pascal usage be about the same?

and yes please, if you have any examples of reading/loading graphics files.
that would be awsome…
here is a link to a sample gfx..egf file //under 5 post so i cant post a normal link.srry
h t t p s://w w w.mediafire.com/?ks6wp13pt1lv30v
it opens with reshacker and has rc data too?

i figured if i could'nt load them i would have to make a .ini file with the bitmap strings in it.

thank you again for the examples.

akarigar

2014-11-27 19:32:56

From: MakIAM
Thank you very much for the examples. this is going to be very helpful.
this is for lape correct?
would the simba/pascal usage be about the same?

and yes please, if you have any examples of reading/loading graphics files.
that would be awsome…
here is a link to a sample gfx..egf file //under 5 post so i cant post a normal link.srry
h t t p s://w w w.mediafire.com/?ks6wp13pt1lv30v
it opens with reshacker and has rc data too?

i figured if i could'nt load them i would have to make a .ini file with the bitmap strings in it.

thank you again for the examples.


No worries, glad to be of help. I would imagine the example should be about the same if you're using the Pascal interpreter, if it isn't, let me know and I can take a look.

The link doesn't seem to be working for me. If you can make ini files, it would be much simpler to work with since you can use the following ini related functions.

function ReadINI(const Section, KeyName, FileName: string): string;
procedure WriteINI(const Section, KeyName, FileName: string);
procedure DeleteINI(const Section, KeyName, FileName: string);

Daniel

2014-12-01 06:53:48

Check out the Simba documentation for reading from and writing to files. :)

MakIAM

2014-12-05 14:21:18

@ daniel
thank you. i will check these out more this week.
i have been working on trans bitmaps this past week. what a head ache.
@ akarigar
the socket stuff seems to be about the same. but i havent figured the usage out yet."time out errors and stuff.

thanks for the help so far.

MakIAM

2014-12-14 04:17:46

thank you both. i have spent the last weeks learning to draw in simba. will be working on the sockets and reading from resource more soon.

P1nky

2014-12-14 05:57:20

From: MakIAM
thank you both. i have spent the last weeks learning to draw in simba. will be working on the sockets and reading from resource more soon.


Looks great dude! Keep us updated, and I sure hope to try out the final piece :D!

MakIAM

2014-12-31 03:01:03

working on a ver of a map editor. got movement of player with attack and sit work on another script.
i need idea's on how to make it draw faster. maybe larger tile group draws at one time, or maybe multi timer thread draws.
C&C welcome on this script.
program MakesMapMessV20;
// you can change the map size at end of script mapsizx and mapsize y
var
DsgnForm:TForm;
TLabel0: TLabel;
Ground:TImage;
groundlayer,Tile,BmpW,BmpH:integer;
GroundPicture,bmps1: TMufasaBitmap;
bmp1,GroundRenderdPicture: TBitmap;
a,b,TileRowX,TileRowY,MapSizeX,MapSizeY,TileId:integer;
c,d,filename,StringOutPut:string;
const
default = 'Comic Sans MS';

procedure YourClickProcedure(Sender: TObject);
begin
//GetBitmapSize(GroundLayer,Bmpw,BmpH);
//StringOutPut:= CreateBitmapstring(GroundLayer);
//WriteLn('This will be saved in a ini file ' + IntToStr(BmpW));
//WriteLn('This will be saved in a ini file ' + IntToStr(BmpH));
//WriteLn('This will be saved in a ini file ' +StringOutPut);
Ground.Left:=Ground.Left-32;
Ground.Picture.Bitmap.handle:=GroundRenderdPicture.handle;
end;
procedure YourClickProcedure2(Sender: TObject);
begin
TLabel0.Caption:='Done';
Ground.Left:=(DsgnForm.Width/(2))-a;//will be based from player x y from warp/or database login start x y info
SetTransparentColor(GroundLayer,clblack);
SetTransparentColor(Tile,clblack);
for TileRowY:= 0 to MapSizeY do //row drawing down/left
begin
for TileRowX:= 0 to MapSizeX do //row drawing right/down
begin
a:=a+32;
b:=b+16;
FastDrawTransparent(a,b,Tile,GroundLayer);
SetBitmapname(GroundLayer,'GroundLayer');
end;
a:= (a - (MapSizeX * (32))-(64));
b:= (b - (MapSizeX * (16)));
end;
GroundPicture:=GetMufasaBitmap(GroundLayer);
GroundRenderdPicture.free;
GroundRenderdPicture:=GroundPicture.ToTBitmap;
Ground.Picture.Bitmap.handle:=GroundRenderdPicture.handle;
Ground.onclick:=@YourClickProcedure;
end;
procedure InitForm;
begin
//DsgnForm\\
DsgnForm:=TForm.Create(nil);
with DsgnForm do
begin
Caption:='Render a Custom map V.20';
Left:=1;
Top:=1;
DsgnForm.Width:=820;
Height:=840;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=0;
color:=clblack;
onclick:=@YourClickProcedure2;
//onshow:=@YourClickProcedure2;
end;
GroundLayer:=CreateBitmap((MapSizey * 33)+(MapSizeX *33)+1000,(MapSizey * 33)+(MapSizey *33)+1000);
SetTransparentColor(GroundLayer,clblack);
SetTransparentColor(Tile,clblack);
a:=(MapSizey * 32)+1;
//Screen\\
Ground:=TImage.Create(DsgnForm);
with Ground do
begin
//TileId:= 4;
//d:= 'News Info';
//FileName := AppPath + 'NewsTest3.ini';
//c:=((ReadINI ((d),(IntToStr(TileId)), FileName)));
c:='meJzVWGtXWkcUPTwFhRoN4vAWTUzarP6E9kM+dEWDD1RQgi8EAggIiDxFnslKTdKsdrU/uHP25TaaNm1eajqL5boMc8/ss88+Z85IdFVDFEmckchd2QZXNu4MLL64UQTowe+Tok5ij0T1pjF92BAVElkS2ySekAiSqJFoMnhRIrFP4uCm8b1/iC6JFgAfAX+eRJJEiMQmiQiJHRJREqcknvGCr2pIzP6O2VHXMOwYqE4B/y4+8mEFyGVcTkj04GCf43LjgyEVmeeZrMmR1YgMiaeYjJM4ZuTODa3/zMyA5eQW+atm13Mdfy1zXnOwTm4G+eQCi1kskziEvNdIhEkMAHuDxCqT7EkaHDEN819HRGLkOTA4C1oZC1dBe7dh4ZXryO6V60PO2FbBs8S/SMx5gmSp4a8K8gg0s42EXcfnCLpaRRY0WGCOoMa1oePXt9SUb7LvV4t8BUE/Aga5bwHUtfG3gJkGfs1hZR7Py3AwBgcfY2ULaGU40jIKOgnbkdfMN638uhKL4JdHbluBzvPYIgF4VXKsa9xhnf0R2QOAV8V8AmvyvF6+Nb0AqIsIzSaKagZOBVGOqkiEDXJv6XlNiJ3iyCbo29cTXwQ5c1gEvVVy5/XugZ4LyAkXE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6ufu58lPWWJ+/A6Hiu4fkzQNoDCVFY6AFMFPxEkDUhuKa0TEdqFnTxaxnP5U9sjRTO/b+YXW0dc5WCqexQw76XRu/AwNul1FgUh+3cg18nXWfc2zD+pNqj1mn2tVm+KK35asbhveDiNSGFoMTYEXmbkHcKNt7+FOSXvDgC5wcMgOt/XstJF4NIlCazDFaz6mePZnomx55GKSnehsHXGVFy1v/KLCXkaui8fSMbicJsFuCPkSzKuZAheZuQd4rPhX7RC8RCFhxPT89kJtRYLGLH0gX8YYQjCNea5Grp3C907EsX9X8PvZzitcJ8BzNK770BRwZfEPhlL8rQbRwq7VzAnFMfKshZRQwZ6EcpjE31dtOCopSbZhiNxDqEtAMqIleF/JIXi5D08QX86zgpcjTXHZ352cQ/dej7P2wMNTF0wXmiZb9C7Ij/3Dwrk30b+OMwGLgO5Je8+At8Tb3XJNTLb5s8NYNsI4d93T7L5t6rcWdXy1Wlj9BsqVeAa+H8vV7k6O5zi/eFUcrG2dd+92aC8adp/vwbdkpp7Y4g+zJ0VYBHUWgme5PILw5mvkvemvH+y3GuS8rBHQPgGvgPISMUd3CWfYXj3vk4A66itBaRpDX1thsH/1VyDj7uMnL9Y3gjiELhGfWSm/iq/3n498EN0j7UUidX791e8f8yZApc9fgTuiYN3g==';
Parent:=DsgnForm;
Ground.Left:=0;
Top:=0;
Width:=(MapSizey * 32)+(MapSizeX *32)+1000;
Height:=(MapSizey * 16)+(MapSizey *16)+1000;
bmps1:=GetMufasaBitmap(BitmapFromString(64,32,c));
bmp1:=bmps1.ToTBitmap;
GroundRenderdPicture:=bmp1;
Picture.Bitmap.handle:=GroundRenderdPicture.handle;
onclick:=@YourClickProcedure2;
end;

//TLabel0\\
TLabel0:=TLabel.Create(DsgnForm);
with TLabel0 do
begin
Parent:=DsgnForm;
TLabel0.Caption:='Click Any Place To Start';
Left:=79;
Top:=74;
Width:=38;
Height:=14;
Font.Name:=default;
Font.Color:=clWhite;
Font.Size:=18;
end;
Tile:=CreateBitmap(64,32);
Tile:=BitmapFromString(64,32,c);
end;

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
DsgnForm.ShowModal;
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
//start\\
begin
a:=(MapSizey * 32)+1;
b:=0;
MapSizeX:=65;//downright rows x //mapsize
MapSizeY:=65;//downleft rows y //mapsize
SafeInitForm;
SafeShowFormModal;
bmps1.free;
freebitmap(Tile);
GroundRenderdPicture.free;
freebitmap(2);
freebitmap(GroundLayer);
//DsgnForm.free;//crashes simba on clicking simba after DsgnForm.free hmm

//this timage "Ground" dont free but also it do not show as Notfreed in debug box ,but i see mem sticking in task manager if this not there//Ground.free\\. hmm
Ground.free; //this frees it from mem after you stop script.if not after running multi times mem loads up and crashes

end.

Frement

2015-01-07 03:35:23

Got any more of those pretty pictures of this project? :)

MakIAM

2015-01-08 18:48:40

From: Frement
Got any more of those pretty pictures of this project? :)

i do. but i will have to learn some more things before the code is updated where i can add the artwork./objects/walls/shadows ,things like that.
I have been drawing the last two years to get enough artwork to add in this project.
thanks for the feedback and interest