Jump to content
  • Advertisement

Dreadstew

Member
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Dreadstew

  • Rank
    Member

Personal Information

Social

  • Github
    JacobStewart64

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Would you like to make music inspired by Morrowind for an MMO? I think that would be great. Something to play on the title screen. Something to play at character selection, something to play in battle, a couple of kinds of ambient musics. I also need sound FX. I'm thinking of using a good high performance windows API to do the sound with so it should be great and include positional effects. I would pay you if my game actually makes money!
  2. Dreadstew

    Hey, anyone wanna collab i guess?

    Will u make me a huge chunked up MMO world terrain that I could use to try and make a decent alpha for my MMO. I mean chunked up as in the terrain is multiple files. That way I don't have to keep the entire terrain in memory all the time. Just the pieces I need. I heard you can export unreal terrains to blender. I would need you to do that. I'll pay you thousands if I make any money off my game. (prob years down the road) Doesn't have to be special. Just for alpha. Something to work with.
  3. Dreadstew

    Golden Age MMO

    Hi, I am developing an MMO that will be like a mix of league of legends and diablo. I'm struggling hard in the graphics department. With some decent graphics this may be a decent game. I am only using ms3d files for terrain and animated meshes (current repo needs updated). I need someone to help me get a good graphics pipeline going with some decent output. Terrain, monsters, humans, different races, little objects for scenery, etc. I need a topdown design of an MMO world artists can work on and I can use in game at the same time to test dynamic loading of chunks, etc. Once we achieve that we're golden. For now there is no gameplay, there is just login and security things going on. Creating accounts and creating characters, encryption and decryption, establishing of keys, etc. A programmer who knows how to implement path-finding could be a huge help. Graphics programmers too. I've got most of it on lock though. My hand is hurting right now from coding so much, that's why I'm on here peddling interest in my game, I gotta take a break for a while and let my hand regain feeling lol. https://github.com/JacobStewart64/GoldenAgeGame
  4. Do you have any code yet? Do you already have coders on your team? Do you have artists? Sounds interesting. I lack artistic capabilities or good creative vision for a game but I'm good with network code. I mainly use C++, I wouldn't want to use much else for a game.
  5. I'm doing this for my game, can you help me out? I don't understand why I need a new IV every packet. I use the same key and iv the whole session. Each client gets their own key and iv sent over https. Won't it throw errors if I change their IV lol? What is IV for lol. Ty for your help.
  6. EDIT: I don't think any of this helps for mobile dev, but it could be interesting to others so I'll leave it. I'm doing the "third option" written above. If you like c++, Enet is good for the udp connections, cpp-httplib is good for the https server and client, and OpenSSL is good for the encryption, decryption of udp packets. http://enet.bespin.org/ https://github.com/yhirose/cpp-httplib https://www.openssl.org/source/ Here is a class I use in my game to encrypt and decrypt data that goes in my udp packet. #pragma once #include <openssl/evp.h> #include <openssl/aes.h> #include <openssl/rand.h> #include <openssl/err.h> #include <string> #include <iostream> //if debug isn't defined, turns into a no-op template <typename ...T> void debug(std::string file, int line, T&& ...args) { #ifdef _DEBUG unsigned int index = file.find_last_of('\\'); file[index] = '/'; index = file.find_last_of('\\', --index); std::string finalfile = file.substr(index); finalfile[0] = '/'; std::cout << finalfile << ":" << line << " "; using expander = int[]; (void)expander { 0, (void(std::cout << std::forward<T>(args)), 0)... }; std::cout << std::endl; #endif } //use this, it outputs the file and line the output was made from! #define debug(...) debug(__FILE__, __LINE__, __VA_ARGS__) namespace ga { class cryptinfo { EVP_CIPHER_CTX* ectx; EVP_CIPHER_CTX* dctx; void fillectx() { debug("making new encryption ctx"); if (!(ectx = EVP_CIPHER_CTX_new())) handleErrors(); debug("setting ctx encryption engine to EVP_aes_256_cbc()"); if (1 != EVP_EncryptInit_ex(ectx, EVP_aes_256_cbc(), NULL, NULL, NULL)) handleErrors(); debug("initializing ctx with key and iv", key, " ", iv); if (1 != EVP_EncryptInit_ex(ectx, NULL, NULL, key, iv)) handleErrors(); debug("making new encryption ctx good"); } void filldctx() { debug("making new decryption ctx"); if (!(dctx = EVP_CIPHER_CTX_new())) handleErrors(); debug("setting ctx decryption engine to EVP_aes_256_cbc()"); if (!EVP_DecryptInit_ex(dctx, EVP_aes_256_cbc(), NULL, NULL, NULL)) handleErrors(); debug("initializing ctx with key and iv"); if (!EVP_DecryptInit_ex(dctx, NULL, NULL, key, iv)) handleErrors(); debug("making new decryption ctx good"); } void filldectx() { debug("make both encryption and decryption ctx at the same time"); fillectx(); filldctx(); debug("make both good"); } void handleErrors(void) { unsigned long errCode; debug("An error has occured in encryption/decryption"); while (errCode = ERR_get_error()) debug(ERR_error_string(errCode, NULL)); debug("should we really exit here?"); system("pause"); abort(); } friend char* operator<<(char* os, cryptinfo &e); friend char* operator>>(char* os, cryptinfo &e); friend std::ostream& operator<<(std::ostream &os, const cryptinfo &e); friend std::istream& operator>>(std::istream &os, cryptinfo &e); public: uint8_t key[33]; uint8_t iv[AES_BLOCK_SIZE + 1]; void fillkeyiv() { debug("creating new key and iv for a cryptinfo"); debug("creating key"); RAND_bytes(key, sizeof(key) - 1); key[32] = '\0'; //always null terminate our data so we can toString() (hope that works out lol) debug("creating iv"); RAND_bytes(iv, sizeof(iv) - 1); iv[16] = '\0'; debug("creating new key and iv good"); } int encrypt(std::string& encrypt_in, std::string& encrypt_out, unsigned char* aad = 0, int aad_len = 0) { debug("encrypt called"); fillectx(); debug("encrypting string ", encrypt_in); int len; int ciphertextlen; unsigned char encrypt_in_buf[48]; debug("writing encrypted bytes to ciphertext"); if (1 != EVP_EncryptUpdate(ectx, encrypt_in_buf, &len, (const unsigned char*)encrypt_in.c_str(), encrypt_in.size())) handleErrors(); ciphertextlen = len; debug("writing final bytes to ciphertext"); if (1 != EVP_EncryptFinal_ex(ectx, encrypt_in_buf + ciphertextlen, &len)) handleErrors(); ciphertextlen += len; encrypt_in_buf[ciphertextlen] = '\0'; debug("free ctx obj"); EVP_CIPHER_CTX_free(ectx); encrypt_out = (const char*)encrypt_in_buf; debug("encrypted string ", encrypt_out); debug("encrypt good"); return ciphertextlen; } int decrypt(std::string& ciphertext, std::string& plainstr, unsigned char *aad = 0, int aad_len = 0) { debug("decrypt called"); filldctx(); debug("decrypting string ", ciphertext); unsigned char buf[48]; debug("writing unencrypted bytes to plaintext"); int len; if (!EVP_DecryptUpdate(dctx, buf, &len, (const unsigned char*)ciphertext.c_str(), ciphertext.size())) handleErrors(); debug("writing final bytes to plaintext"); int oldlen = len; int ret = EVP_DecryptFinal_ex(dctx, buf + oldlen, &len); oldlen += len; buf[oldlen] = '\0'; debug("freeing ctx obj"); EVP_CIPHER_CTX_free(dctx); plainstr = (const char*)buf; debug("the decrypted string ", plainstr); if (ret == 1) { debug("decryption good"); return oldlen; } else { debug("EVP Decryption Error! check != -1"); debug("decryption failed, but the program could be configured to work anyway, sometimes the decrypted data comes out fine but it throws errors anyway, probably because something is coming up as insecure"); return -1; } } std::string keyToString() { return (const char*)key; } std::string ivToString() { return (const char*)iv; } void keyFromString(std::string key) { strcpy((char*)this->key, key.c_str()); } void ivFromString(std::string iv) { strcpy((char*)this->iv, iv.c_str()); } }; std::ostream& operator<<(std::ostream &os, const cryptinfo &e) { debug("writing cryptinfo key and iv to stream"); debug("writing key"); for (int i = 0; i < 32; i++) { os << e.key[i]; } os << e.key[32]; debug("key written"); debug("writing iv"); for (int i = 0; i < AES_BLOCK_SIZE; i++) { os << e.iv[i]; } os << e.iv[16]; debug("iv written"); debug("writing cryptinfo to stream good"); return os; } char* operator<<(char* os, cryptinfo &e) { debug("writing cryptinfo key and iv to buffer"); debug("writing key"); for (int i = 0; i < 33; i++) { os[i] = e.key[i]; } debug("key written"); debug("writing iv"); for (int i = 33, j = 0; i < 33 + AES_BLOCK_SIZE + 1; ++i, ++j) { os[i] = e.iv[j]; } debug("iv written"); debug("writing cryptinfo to buffer good"); return os; } std::istream& operator>>(std::istream &os, cryptinfo &e) { debug("reading key and iv from stream into cryptinfo"); debug("reading key"); for (int i = 0; i < 33; i++) { os >> e.key[i]; } debug("key read"); debug("reading iv"); for (int i = 0; i < AES_BLOCK_SIZE + 1; i++) { os >> e.iv[i]; } debug("iv read"); debug("reading key and iv from stream good"); return os; } char* operator>>(char* os, cryptinfo &e) { debug("reading key and iv from buffer into cryptinfo"); debug("reading key"); for (int i = 0; i < 33; i++) { e.key[i] = os[i]; } debug("key read"); debug("reading iv"); for (int i = 33; i < 33 + AES_BLOCK_SIZE + 1; i++) { e.iv[i] = os[i]; } debug("iv read"); debug("reading key and iv from buffer good"); return os; } };
  7. Dreadstew

    Managing a growing project

    There's always UML if you want to diagram things super formally. Sounds like you are knee deep in complexity from pursuing a modular approach. I would say code that won't be reused outside of the project doesn't need to be overly designed. As a general rule, I don't even design very hard I just jump in and code, then refactor into a design I like that helps me not repeat code everywhere. For example, I have a project that includes a game server, login server, and client. I have code that I refactored into a module that I can use across all three projects. I did this for udp communication, encryption and decryption, and a few other things. Other code I have no desire to use across projects and so I worry much less about its design. It is partitioned into functions/objects that minimize repeating of code. And that's all I do, my project spirals outwards, I refactor, add feature, etc. Old features are in old files I don't have to touch very often. The biggest way to not touch old code is to truly 100% finish a feature before moving on to other features, taking into account everything you can. This is how I am tackling the complexity of my MMO project. I will not add new features until I am 100% done with features that come before it. It has helped me flesh out the design of my data very well. I need a 100% decided on data structure to represent players and accounts, etc. As I said finishing features rigorously helps to prevent from touching old code, unless something about your design is the culprit. My simple designs do not have rippling effects from changes, and all I did was not repeat code. Just divided it up with an eye to not repeat code and to provide a good interface. I already have 3 or 4 classes shared across projects I haven't changed a bit. If you can manage to write code abstract enough to work across projects, it seems you don't have to work on it often.... there's that lol. The code in those files does what it's supposed to do and there's no changing requirements on my end... maybe it's just a miracle lol.
  8. I think what you want to do is get the entity from the ECS and pass its location to the world loot system's function you're calling. The ECS should have an ID or string key for the entity you can probably keep in an array/linked-list. I'm assuming the ECS is like the warehouse for entities and you don't want to duplicate any data. Getting a pointer to the entities from the ECS with an ID or string key should be O(1). But don't store the pointer in the world loot system. Just use it to pass it the parameters it needs to do its job. I could be way off idk.
  9. I would just use static libraries unless you plan for the user to run multiple applications at the same time which use the same DLL. Then DLLs can save them ram. When using static libraries only code that is called in your app is included in the .exe, not the whole lib. It sounds like Engine library needs two types, client and server, and they can reference shared code from an external include/lib folder and be built separately.
  10. Dreadstew

    Managing a growing project

    Decide on your interface first. By that I mean when you are designing, decide the return type and argument types once and for all. As long as those stay the same your implementation can change without breaking other code too bad. But yeah sounds like you actually want to plan this time, so make a good design plan. It doesn't have to be 100% object oriented. Just specify all the pieces as prototypes and leave the implementation for later. Data first style kinda. Get all libraries you will need together so you can use types from them in your prototypes. One way to plan is to go ahead and write your program in non-existant functions and objects, pretending that they do certain things. If you are good at makebelieve, all you have to do is implement your "skeleton" and it is done.
  11. Dreadstew

    Dealing with my messy code

    You have to set aside good chunks of time for refactoring. The main goal is to increase code reuse. Some code can be shared between projects. Some code is repeated multiple times in your project and needs to be factored into a function with the correct arguments. It seriously helps when there is only one place you need to edit code to make "one change" in your system. Chunking your program up into classes and free functions and moving them into their own files - organizing - is a really good way to stay productive too. I once had the same problems as you and wondered if I was just unintelligent but It's been quite a few years now and I'm fairly successful I would say. Don't worry. You'll get better. A good debug output function that tells the line and file the debug statement is in helps to keep track of where code is all at as well. Use #ifdef _Debug or an equivalent to have the debug function just compile out of your program in release mode. #pragma once #include <string> #include <iostream> //if debug isn't defined, turns into a no-op template <typename ...T> void debug(std::string file, int line, T&& ...args) { #ifdef _DEBUG unsigned int index = file.find_last_of('\\'); file[index] = '/'; index = file.find_last_of('\\', --index); std::string finalfile = file.substr(index); finalfile[0] = '/'; std::cout << finalfile << ":" << line << " "; using expander = int[]; (void)expander { 0, (void(std::cout << std::forward<T>(args)), 0)... }; std::cout << std::endl; #endif } //use this, it outputs the file and line the output was made from! #define debug(...) debug(__FILE__, __LINE__, __VA_ARGS__) One of the simplest examples of one edit to one change in the system is a simple define for a file path string. Now if the file path changes, you can edit one bit of code to change your whole system. It's that kind of thing that will save your life and make you glad you chose to take the time to write good code. Try to write code you can control from variables like that. It forces you to think how to make a flexible system. Take pieces of repeated code and turn them into little systems (functions) with variables (parameters) that can accomplish the task in a more abstract way. Your files will shrink and you will slowly gain the "one edit one change in the system" level of abstraction. Another little goal I have when refactoring is to make my main function small by factoring things out of it into their own functions. E.G. my game loop goes inside a gameLoop function and my main shrinks by 50 lines. Then shrink gameLoop, factor out some stuff inside of it into a function - aiming to decrease code duplication first and foremost, but also just trying to make gameLoop smaller. Makes the program more readable. And always use good names. A good name for an out parameter that will contain an encrypted string might be "encryptedstr" but IMO encrypted_str_out will probably be better. Underscore with long descriptive names FTW.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!