• Advertisement

menyo

Member
  • Content count

    530
  • Joined

  • Last visited

  1. Server battle predictions?

    Thanks, your first solution made me think about game replay's so I googled that. I think this is the best way to go, I guess all I need my game to be deterministic and start on all clients in the exact same state. If I ever want user interaction I could send input with it. Edit: I found another great article to have fixed time steps for a deterministic outcome. Unity has the method 'FixedUpdate()' for this but some engines might not or even combine the draw and logic loop.
  2. Does a server need a gui?

    Thank you, could you list the pro's and cons of the different methods? My guess is a specialized client suits my needs, A web interface maybe just for the database if I ever want to create an api for it.
  3. I have a bit of experience with client/server architecture and up till now all my server did was relay and occasionally verify data to it's connected clients. I have even less experience with deploying a server, I did that once on a free amazon AWS tier. Anyway, I am planning on making a larger networked game and I am wondering if such a server needs GUI, or at least a command line console and if that is even possible to run from a vpn. Another way to check and correct/alter server data is to make a separate client that logs in on the server that has all kind of other privileges and a gui of itself. I know this is a broad question but I like to know what is common so I can anticipate on this while writing my server.
  4. I got a little client side auto battle game going, you pick some units and the battle progresses visually but automatically with a lot of random elements. However, I want need to verify the outcome by the server. I also want to be able to let clients duel other clients. So what is the best take on this problem? Instead of heaving the complete battle play out on the server or check/compare every action from the client that is being played out randomly I figured it must be possible to just calculate the outcome quickly and once the client has finished the battle just verify that result with the server. I would just generate a seed on the server, pass that to the clients so the battle can be generated and played for them. In the meantime the server quickly calculates the outcome and checks that result with the client. Is this possible at all? Would a seed generate the same random numbers on each and every machine when using the same Random() implementation? Should I just loop trough the whole battle on the server side? Like moving each unit, detect hit, fight, damage, etc but instead of doing that each frame just in a single loop? Can I perhaps skip trough and interpolate these steps? Just let the game play on the client and check each action with the server. Both clients would still need to get the same seed and the server needs the match the action with it's own "battle". I expect the outcome of both clients to defer from the server outcome. Same as above. Have the server run and dictate the battle and the client just displays what is happening. Since the battle has random elements the client needs to ask the server each frame what to do which is a problem. I really cannot set the random aspect aside, units have to be able to "dodge" or "critical" every now and then. But perhaps this can be implemented in a different way since the battle outcome should be fixed. As you see I'm having trouble wrapping my head around the whole concept. I have a fairly good understanding of network gaming. when the player controls a character you could let the client just do it's thing and occasionally checking variables and correcting the client based on server state. With my automatic battle the outcome of the game should be fixed and predetermined, especially when having clients PvP.
  5. Hi, I want to create a fairly large "tilemap" with 3D assets. I started testing and have very promising results with generating the terrain mesh by code. private Mesh createChunck(int width, int height) { Vector3[] verts = new Vector3[width * height * 6]; Vector2[] uvs = new Vector2[width * height * 6]; int[] triangles = new int[width * height * 6]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { //Debug.Log("x: " + x + ", y: " + y); verts[(y * width + x) * 6 + 0] = new Vector3(x, 0, y); verts[(y * width + x) * 6 + 1] = new Vector3(x + 1, 0, y); verts[(y * width + x) * 6 + 2] = new Vector3(x + 1, .5f, y + 1); verts[(y * width + x) * 6 + 3] = new Vector3(x, 0, y); verts[(y * width + x) * 6 + 4] = new Vector3(x + 1, .5f, y + 1); verts[(y * width + x) * 6 + 5] = new Vector3(x, 0, y + 1); uvs[(y * width + x) * 6 + 0] = new Vector2(0, 0); uvs[(y * width + x) * 6 + 1] = new Vector2(1, 0); uvs[(y * width + x) * 6 + 2] = new Vector2(1, 1); uvs[(y * width + x) * 6 + 3] = new Vector2(0, 0); uvs[(y * width + x) * 6 + 4] = new Vector2(1, 1); uvs[(y * width + x) * 6 + 5] = new Vector2(0, 1); for (int t = 0; t < 6; t++) { triangles[(y * width + x) * 6 + t] = (y * width + x) * 6 + 5 - t; } } } Mesh m = new Mesh(); m.vertices = verts; m.uv = uvs; m.triangles = triangles; m.RecalculateNormals(); return m; } I can easily render 10 x 10 "chuncks" of 100 x 100 tiles in a scene which is should be enough. However I need the tri's to be able to change material individually, by code. Obviously without (re)generating the mesh again since that does take some time. With the following code I can change and add submeshes to the mesh. test.subMeshCount = 2; int[] tri1 = new int[] { 5, 4, 3 }; int[] tri2 = new int[] { 2, 1, 0 }; test.SetTriangles(tri1, 0); test.SetTriangles(tri2, 1); And it seems like simply adding a Material array to Graphics.DrawMesh(...) but unfortunately it only takes a single material and all the triangles that are out of the submesh group 0 are not being drawn. I could probably create a GameObject with a renderer component and thrown in the mesh and create my material array there but I don't really need/want a GameObject. I'm just looking for a clean way to render this mesh my script with different materials for it's submeshes by script. In case you are interested in the stats of rendering 1.000.000 tiles using 100 large meshes here is a screengrab. Looks promising, but I got to be able to change texture/material on individual tiles dynamically. With this setup I might look into a perspective cam and allow for a slightly sharper angle on the camera.
  6. I'm currently testing out behaviortree's with the LibGDX AI library. I have read a lot about behaviortree's past couple days but it's hard to get clear how I need to build the tree for my specific scenario. I'm looking to use a behaviortree for a Rimworld like game where the players units are not directly controllable. In the first place I'm wondering if I should have a single big tree for the complete AI or many smaller tree's, for example a separate tree for: Moving an item Building a building Crafting an item Resting when sleepy Eating when hungry In the examples I have seen they all talk about a "single job". Like entering a building, GoTo -> Open Door -> GoTo -> Close door. But what if I need to check if I have the keys on me? And I need to check a lot of these variables. When A unit is Idle I'd like him to maintain his primary needs if he has access to them. If his needs are satisfied enough he can take on certain jobs like building walls or crafting items. I have a a lot of different jobs but jobs like building or crafting items are relatively the same with a different outcome so I could probably make a abstract job for that, it helps but I will still end up with a really huge tree though. Another issue I'm facing is that when tasks are running, and something more important pops up (enemy spotted or some kind of emergence task) the unit should stop it's current task and act accordingly to the interruption. So since the task is running I need to do those checks on each runnable task then returned failed/cancelled and further down the sequence I need to do another check for these interruptions and handle them accordingly. I have briefly read into dynamic branches, not sure if GDX AI supports this but adding a behavior to the tree to handle an interruption seems a good idea. These dynamic branches also opens the opportunity to hold behaviors at the jobs and once a unit accepts a job it inserts that branch into it's own tree. I hope I'm clear, it's hard to explain and get a global view of a complex behavior tree. I have read several times that behavior tree's are very easy to understand and implement. Well, that might be the case for those small tree's I find everywhere. On the other hand I might be over complicating things.
  7. Ok, that makes a lot of sense. When the user loses his token he will be presented with the login screen again and if he registered/linked his previous account he can get his token back otherwise he has to create another guest account. How does this token look? Is it just a "long" random char field that does not have to be unique since the username is already unique? And does this need to be encrypted or can I just store it locally in a obvious user settings file?
  8. Could you elaborate on an authentication token? Wouldn't that be the same as a password? The issue is the user need to be able to return to his account after he re-installs the game. If I would store the token locally it won't be available on a different device. And yes I meant hashing, should get that terminology right but I did use hashes for a website a couple of years ago. Any idea on what to use with Java? I understand that securing users credentials is important since most of them use the same password for everything. But using a password like this I need to store it locally as well to automatically sign in. So I think I do need to encrypt it locally and then decrypt it on the server where I will check the password+salt vs the hash.
  9. I want to reverse engineer what most mobile multiplayer games do with there login system and with that I mean the user is able to start to play immediately with a guest account and can later fill in a name and link with Google, Facebook or email/password. I think I need the following steps the moment the user presses "play immediately". Create a unique user name, something like guestXXXX and a password. Store Username and password locally. Encrypt password locally. Store the username and password in the database. Encrypt password with a unique salt. Now when the player boots up the game again he will skip the login step since there are local credentials. The only problem I see here is when the user does not register an email, his own password or links with a social media account he will lose his account once he loses his local credentials, most likely with an uninstall. But I think it's very good to have the user play first before he commits with yet another username and password or link with Facebook. I can always throw in a warning when an account is not linked every now and then and give a small bonus when the user links it. Am I forgetting something here? Are there other proven methods so the player can get engaged immediately?
  10. Either start on this game, make it open source and get free help or get a loan to pay for employees or freelance work. Getting a " a faithful, loyal, and dedicated team" that can handle a complete game will be next to impossible. Kickstarter would be another option, still you need to be able to show some great stuff, at least a prototype with some gameplay and the mood you are going for.
  11. This is not the right place to post this. If you are offering a paid job you should post at the jobs section otherwise request to move this to the hobby projects. I wouldn't boost to much about your idea though, every programmer knows ideas are worth nothing, if you are serious about it and offering a paid job then just a view worth about it should be enough. Talk more about what is to be expected from the persons you are looking for and what they can get out of it.
  12. Someone probably already mentioned this linear solution but why not have your damage mitigation mitigate healing at the same rate? However if healing is a big part of the game then a damage mitigation role would be the same as a HP role. Perhaps make your damage mitigation class not healable in a regular way or have a limit on the amount of heals. Don't worry about the lore, you can always think of something to make the mechanic fit into the lore of the game.
  13. Look into original roguelikes perhaps? There are no real good 3d ones out there that I am aware of. If I would rock at 3D I would go for that immediately.
  14.   I don't like it at all. All these games you mentioned have one huge common mechanic, management without a time limit. Make it real time without being able to pause would break that. If such a game would exist, the people with the most spare time would rule unless if there was money involved then that title would go to the richest. Trade, wealth, war and conquest? Sounds exactly like traditional browser games. 
  15. It would make the game a lit easier I guess. The mechanics would change to "rush to powerups". I don't think the single player mode would benefit from this. It might be interesting for a multiplayer game but if player "A" has quicker access to a good power up then player "B" you have balance issues that might be hard to fix.
  • Advertisement