Can SDL_net be easily hacked into GAME.EXE?

Talk about things that are not making games here. But you should also make games!

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
Chronoboy
Slime Knight
Posts: 281
Joined: Tue Nov 30, 2010 6:01 am
Location: Canada

Can SDL_net be easily hacked into GAME.EXE?

Post by Chronoboy »

I haven't look at the OHR source code too closely, but I was wondering if I could modify the plotscript engine to enable new plotscripts for network communications?

Plotscript is very powerful and having access to SDL_net within Plotscript would be very nice. A plotscript would be used to initiate the SDL_net backend before any network communications would be used.

Here is an example of what I would like to see:

Code: Select all

http request ('http://server/script', 'data1=hfh&data2=fjf', @callback script)

script, callback script, response, begin
  ----  Do stuff with the response text ----
end
If anybody has programmed in JavaScript before, this technique may look familiar. Basically, I would love to implement an AJAX request feature directly in Plotscript. This could be used to send off high-score data, or to unlock items in the game through a website. The possibilities are endless, and since it's a very simple networking function, it's stateless, there's no need for the engine to keep track of anything. :)

Let me know if this is possible and where in the source code I would need to dig into, then I'll need to edit hspeak.exe as well to add the new plotscripts in to compile. I'll be sure to submit it back to the main development team of OHR for inclusion if anybody else finds this type of networking feature handy.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

I don't know anything about JavaScrpit, so I can't help you.

Are you planning to use plotscript on websites? :o
I like the idea. Sounds interesting, but also difficult.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Networking support has been requested before, and I have always rejected the suggestion. The OHRRPGCE has always been a single-player thing, and hacking in network support can't be a priority over other unfinished core features.

More importantly, plotscripting has only one data type, the integer.

Maybe someday after strings and arrays and complex data types are possible in plotscripting, then I would be willing to consider a feature that could send and receive data objects with a server, but right now, when it would just be integers, it would be a horrible thing to work with.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I'm in complete agreement with James: it's too early for something like that.

Why do you suggest sdl_net?
Chronoboy
Slime Knight
Posts: 281
Joined: Tue Nov 30, 2010 6:01 am
Location: Canada

Post by Chronoboy »

TMC wrote:Why do you suggest sdl_net?
I thought since other parts of the engine are built using SDL components, using the net component might be the easiest to implement. I haven't tinkered around much with FreeBASIC, so I could be wrong.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Oh, in that case, no, that's definitely not any reason to use SDL_net. And I'm actually pretty suspicious of the quality of any library with "sdl_" in the name.
Last edited by TMC on Mon Nov 28, 2011 11:52 am, edited 1 time in total.
Post Reply