Eiken Posted December 5, 2012 Share Posted December 5, 2012 Hi all! I would like to ask about creating online games in Leadwerks. Is it possible? And is there too much problems for it? Isn't is too difficult? Thank you for your help. Quote Link to comment Share on other sites More sharing options...
Canardia Posted December 5, 2012 Share Posted December 5, 2012 It's very simple actually. You can use a normal Apache PHP server, and send HTTP requests to the server. For sending HTTP request, you can use for example libcurl ( http://curl.haxx.se/ ), which is very easy to use, for example: /* A multi-threaded example that uses pthreads extensively to fetch * X remote files at once */ #include <stdio.h> #include <pthread.h> #include <curl/curl.h> #define NUMT 4 /* List of URLs to fetch. If you intend to use a SSL-based protocol here you MUST setup the OpenSSL callback functions as described here: http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION */ const char * const urls[NUMT]= { "http://curl.haxx.se/", "ftp://cool.haxx.se/", "http://www.contactor.se/", "www.haxx.se" }; static void *pull_one_url(void *url) { CURL *curl; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_perform(curl); /* ignores error */ curl_easy_cleanup(curl); return NULL; } /* int pthread_create(pthread_t *new_thread_ID, const pthread_attr_t *attr, void * (*start_func)(void *), void *arg); */ int main(int argc, char **argv) { pthread_t tid[NUMT]; int i; int error; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); for(i=0; i< NUMT; i++) { error = pthread_create(&tid, NULL, /* default attributes please */ pull_one_url, (void *)urls); if(0 != error) fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls); } /* now wait for all threads to terminate */ for(i=0; i< NUMT; i++) { error = pthread_join(tid, NULL); fprintf(stderr, "Thread %d terminated\n", i); } return 0; } This example is also multi-threaded, so it doesn't stop your LE main thread while sending/getting HTTP data from the web server. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted December 5, 2012 Share Posted December 5, 2012 What kind of online game were you thinking of making? Also is this your first game or have you made some before? If it is your first I would recommend staying away from online until you have more experience. Also "It's very simple actually." is not actually true. It is actually relatively complex. Not necessarily difficult to send data over a network but making that data work nicely for you is another story. For online games take a single player game and multiply the difficulty by 10 and that will give you an idea..... if by online you mean mmo then multiply that difficulty by 100 instead. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted December 5, 2012 Share Posted December 5, 2012 i agree... the complexity of the multiplayer logic will definitely depend on what type of game you are making... an online game like words with friends, chess, or checkers will not require the same level of complexity as an online FPS... logic will have to be included to sync the fast paced action across the wires... animation, collisions, smooth movements, etc are issues that will all have to be addressed for shooters and the like that will not be necessary in the latter... the basics of establishing the connection will soon become trivial as the requirements of the simulation increase... my opinion... if you intend to develop a multiplayer game, you should include multiplayer logic into your engine from the very beginning... even if your first versions will be single player only... i also feel that you should determine from the start the structure (where the interactions are going to take place, server only or distributed) as this will affect everything that follows... one final thing... forget the code right now... the code is usually the last thing i do... write out the logic in plain language first... go thru the logic for possible faults... then lay down the code to correspond with the logic that you've come up with... i've found that code that is based on sound logic will usually work, and is easier to understand and debug... --Mike Quote Link to comment Share on other sites More sharing options...
Eiken Posted December 5, 2012 Author Share Posted December 5, 2012 We are making MMORPG game. So, is any programme for server needed? If it is, which one? And is a lot of programming skill needed to set a server connection? Are there any special server tools in Leadwerks Engine? Which ones? And which language is the most suitable language for making a MMORPG in Leadwerks? Thank you all for your help. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted December 5, 2012 Share Posted December 5, 2012 sorry... that's beyond my capabilities at the moment... but i think there are a few devs online here that can give you some solid info... good luck... --Mike Quote Link to comment Share on other sites More sharing options...
Josh Posted December 5, 2012 Share Posted December 5, 2012 I recommend RakNet for an MMO. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted December 5, 2012 Share Posted December 5, 2012 I try to say this with respect but if you are one of the developers and you're asking some of the questions you are asking, then you guys are not ready to make an MMO. Start with a smaller network game first to get your feet wet. 1 Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted December 5, 2012 Share Posted December 5, 2012 I agree with Rick, no one currently capable of making an MMORPG would be asking such questions. Scale your ambitions right down and learn the basics by developing something far simpler! You will find that challenging enough but can then apply what you've learnt to something more ambitious. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Guest ant0N Posted December 6, 2012 Share Posted December 6, 2012 We are making MMORPG game. So, is any programme for server needed? If it is, which one? And is a lot of programming skill needed to set a server connection? Are there any special server tools in Leadwerks Engine? Which ones? And which language is the most suitable language for making a MMORPG in Leadwerks? Thank you all for your help. Try to make a simple game on this engine. After that you will have no such issues and possible desires, too. низамарачивайся этим двишком... Quote Link to comment Share on other sites More sharing options...
Eiken Posted December 6, 2012 Author Share Posted December 6, 2012 I recommend RakNet for an MMO. Thank you! Is it compatible with Leadwerks Engine? Quote Link to comment Share on other sites More sharing options...
DaDonik Posted December 6, 2012 Share Posted December 6, 2012 It's up to you to combine LE2 and RakNet in a way that suits your needs. Both of them are accessible from C++. I don't mean to be rude, but not knowing that doesn't put you in a place where you are able to make a MMORPG. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Rick Posted December 6, 2012 Share Posted December 6, 2012 Thank you! Is it compatible with Leadwerks Engine? Raknet allows you to send data/receive data over a network. Data is abstract. It's whatever you want to send. If you want to send a position of an LE model then you would get the LE model position and send it's values over the network via Raknet. You aren't sending anything LE specific, just numbers and strings. You have to make the connection between these numbers and strings and how it translates to/from LE. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 6, 2012 Share Posted December 6, 2012 Finishing a small game is hard enough as it is. I would set that as a first goal before trying something as large as an mmorpg. @Rick, well said. If you need to ask those questions, then forget about making such a massive project like an mmorpg. Still, good luck with your game. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.