• Advertisement

wayneprim

Member
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

148 Neutral

About wayneprim

  • Rank
    Member

Personal Information

  • Interests
    Design
    DevOps
    Programming
  1. Building my Own Server, Help

    Also, I think for this first project I may just go with using something like SmartFox. However, I do want to learn more about building my own "Smart Fox" as a learning experience. Where can I start for this?
  2. Building my Own Server, Help

    Thanks for the info. I am going to look into that. One game I really love and have wondered how they do their networking is Slither.io on mobile... I know it started as a web based game but how do they make a mobile game like that so smooth?
  3. Building my Own Server, Help

    I will be making a game that has 15-25 players fighting against each other in real time in 2D. (Fist Fighting) The game will run on ios and later android..
  4. I have been hearing a ton about building your own servers to create networked real time multiplayer games. However, I am a complete beginner to this and would like to know where I can start... I have good experience in node.js/express/socket.io and creating games in unity... so I get the basic concepts and am somewhat familiar with what servers do but I don't know how one would even go about creating a server (writing a server)... Could someone point me in the right direction? Thanks in advance!!
  5. I want to build a real-time multiplayer game using nodejs as a backend and preferrably socket.io. I have had a very tough time researching anything reliable online on what the best ways to perform this are as well as the pros and cons of it. Could someone point me in the right direction? I am open to as many other options as well. The thing I like about the idea of using nodejs is that it is something I am familiar with and I find it can be very fast and light weight. But does it integrate well with unity and mobile? Where should I go as a resource to learn more about servers and multiplayer game development in general? Its also important to note that I have tried out Photon as well as UNET and I do enjoy them but I am looking for other options... Anyway, thanks in advance. Looking forward to seeing your responses.
  6. entering a string of data to an ofstream file

    never mind I got it with cin.ignore() thanks for the help!!
  7. entering a string of data to an ofstream file

    Thanks, but now when I change cin>> to getline() the program doesn't let me enter the data. Instead it just skips the data and jumps to your data has been entered successfully... Is there anyway to make the program "pause" to allow me to enter the data?
  8. entering a string of data to an ofstream file

    because when I use it in the main function, getline(cin, filedata), and then run the program i automatically skips that and doesn't let me enter anything.
  9. entering a string of data to an ofstream file

    do i use the getline on the function that is called or when I first get the input from the user?
  10. I am trying to create a program that allows the user to do 2 things (create a new file in the current directory, or search a file and display the word count) The word count works fine but when I try to allow the user to create a file it starts going wrong. I first ask the user to input a filename, and then enter some initial data into a string variable. That string variable gets passed to the createFile() function which takes care of entering the data into the file. When I run this program I enter the file data I wish to put in the created file, say for example " Hello File Data" and when I look into that file once its been created there is only the first word ("Hello") in the case of this example. Here is the code: The main function: [source lang="cpp"] cout << "Enter the file name: " << endl; cin >> filename; outFile.open(filename.c_str());//create the file if (!outFile) { //file could not be created cout<< "File could not be completed" << endl; break; } else // file was created cout << "FILE WAS COMPLETED NAMED: " << filename << endl;; //ask the user to put some data y/n cout << "Would you like to set some initial data in the file? y/n" << endl; cin >> choice; switch(choice) { case 'y': cout << "Enter the data: " << endl; cin >> filedata; user1.createFile(outFile, filedata); break; case 'n': cout << "Ok then dont create initial data... Your created file is blank" << endl; break; } [/source] The create filefunction: [source lang="cpp"] void User::createFile(ofstream &outfile, string filedata) { //output the file into outfile outfile << filedata; cout << "You have successfully saved the data you entered" << endl; } [/source] Please help! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Thanks I will attach the zip folder as well just in case...
  11. Why even use virtual functions in a Parent class?

    thanks for all the help, I got it now! lol
  12. Why even use virtual functions in a Parent class?

    This does help, thanks!! I just feel like making that virtual declaration in Automobile is so useless still, because if I wanted I could just erase it, and then in the main.cpp just call Ferrari auto("NAME"); auto.drivespeed(); maybe ill get it more when there are more complex functions but it just seems like a useless addition... lol sorry if I am not getting this... the answer is probably very simple and will be something like, "Ohhhh, wow I see it now.."
  13. Why even use virtual functions in a Parent class?

    hopefully this isn't so to everyone but in the second block of code it seems to be cut off... ill include it here: //implementation of classes void Automobile::drivespeed() { //does nothing cout << "UNDEFINED" << endl; } Ferrari::Ferrari(string name) :mName(name) { } void Ferrari::drivespeed() { //drives fast cout << "DRIVES REALLY FAST" << endl; }
  14. So I am learning about inheritence and currently I am on polymorphism... I got the whole inheriting functions from the parent class in order to not duplicate code however I am stuck on one thing: The virtual function... So say I have a class named Automobile like so with a child class that is named Ferrari: [source lang="cpp"] class Automobile { public: virtual void drivespeed(); }; class Ferrari: public Automobile { public: Ferrari(string name); void drivespeed(); private: string mName; }; [/source] [source lang="cpp"]//implementation of classes void Automobile::drivespeed() { //does nothing cout << "UNDEFINED" << endl; } Ferrari::Ferrari(string name) :mName(name) { } void Ferrari::drivespeed() { //drives fast cout << "DRIVES REALLY FAST" << endl; } [/source] now in the main.cpp file in the main function i could write like so... [source lang="cpp"] int main(int argc, char **argv) { Automobile *auto = new Ferrari("Spider"); //invoke drivespeed function auto->drivespeed(); return 0; } [/source] all this does is creates an object of the ferrari type (upcasting it to the automobile type) and then lets me invoke methods of that class... So here is my question: What difference does the virtual function declaration in the Automobile class make? Couldn't I skip the declaration in automobile function since it is really not even a function (it does nothing) and just declare the function as normal in the Ferrari class? and if i made more child classes of the parent class Automobile, i could do the same? Please let me know Thanks, Wayne Prim
  • Advertisement